]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/ruby/database.c
ruby: new notmuch_rb_object_destroy() helper
[notmuch] / bindings / ruby / database.c
index 4ecc8f78f99225da983bbf6d16d0bdd0599e588e..bb993d8688848df012f26d4f9a545f31b78c195d 100644 (file)
@@ -114,11 +114,7 @@ VALUE
 notmuch_rb_database_close (VALUE self)
 {
     notmuch_status_t ret;
-    notmuch_database_t *db;
-
-    Data_Get_Notmuch_Database (self, db);
-    ret = notmuch_database_destroy (db);
-    DATA_PTR (self) = NULL;
+    ret = notmuch_rb_object_destroy (self, &notmuch_rb_database_type);
     notmuch_rb_status_raise (ret);
 
     return Qnil;