X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=bindings%2Fruby%2Fmessages.c;h=35b5d146b06a9824bf421e3f25c330c23b45db7b;hp=94b0b0daad836f7e1c54d4e38a4ac0f10e49b655;hb=5c9e385591b66fa20cbb186393c48c52831a23b7;hpb=d2a457a5d8238c54445a8a6066f79c112ebd3a04 diff --git a/bindings/ruby/messages.c b/bindings/ruby/messages.c index 94b0b0da..35b5d146 100644 --- a/bindings/ruby/messages.c +++ b/bindings/ruby/messages.c @@ -28,11 +28,12 @@ VALUE notmuch_rb_messages_destroy(VALUE self) { - notmuch_messages_t *fnames; + notmuch_messages_t *messages; - Data_Get_Struct(self, notmuch_messages_t, fnames); + Data_Get_Notmuch_Messages(self, messages); - notmuch_messages_destroy(fnames); + notmuch_messages_destroy(messages); + DATA_PTR(self) = NULL; return Qnil; } @@ -48,9 +49,7 @@ notmuch_rb_messages_each(VALUE self) notmuch_message_t *message; notmuch_messages_t *messages; - Data_Get_Struct(self, notmuch_messages_t, messages); - if (!messages) - return self; + Data_Get_Notmuch_Messages(self, messages); for (; notmuch_messages_valid(messages); notmuch_messages_move_to_next(messages)) { message = notmuch_messages_get(messages); @@ -71,7 +70,7 @@ notmuch_rb_messages_collect_tags(VALUE self) notmuch_tags_t *tags; notmuch_messages_t *messages; - Data_Get_Struct(self, notmuch_messages_t, messages); + Data_Get_Notmuch_Messages(self, messages); tags = notmuch_messages_collect_tags(messages); if (!tags)