]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/ruby/filenames.c
lib: Improve notmuch_database_{add,remove}_message documentation.
[notmuch] / bindings / ruby / filenames.c
index 23553ab14e15f6f322b2f653737a61479a13cc0f..f577173021b3755d8fcc1c03fd7c3082e6bfae65 100644 (file)
@@ -21,7 +21,7 @@
 #include "defs.h"
 
 /*
- * call-seq: FILENAMES.destroy => nil
+ * call-seq: FILENAMES.destroy! => nil
  *
  * Destroys the filenames, freeing all resources allocated for it.
  */
@@ -30,9 +30,10 @@ notmuch_rb_filenames_destroy(VALUE self)
 {
     notmuch_filenames_t *fnames;
 
-    Data_Get_Struct(self, notmuch_filenames_t, fnames);
+    Data_Get_Notmuch_FileNames(self, fnames);
 
     notmuch_filenames_destroy(fnames);
+    DATA_PTR(self) = NULL;
 
     return Qnil;
 }
@@ -48,9 +49,7 @@ notmuch_rb_filenames_each(VALUE self)
 {
     notmuch_filenames_t *fnames;
 
-    Data_Get_Struct(self, notmuch_filenames_t, fnames);
-    if (!fnames)
-        return self;
+    Data_Get_Notmuch_FileNames(self, fnames);
 
     for (; notmuch_filenames_valid(fnames); notmuch_filenames_move_to_next(fnames))
         rb_yield(rb_str_new2(notmuch_filenames_get(fnames)));