return Data_Wrap_Notmuch_Object (klass, ¬much_rb_database_type, NULL);
}
+/*
+ * call-seq: DB.destroy => nil
+ *
+ * Destroys the database, freeing all resources allocated for it.
+ */
+VALUE
+notmuch_rb_database_destroy (VALUE self)
+{
+ notmuch_rb_object_destroy (self, ¬much_rb_database_type);
+
+ return Qnil;
+}
+
/*
* call-seq: Notmuch::Database.new(path [, {:create => false, :mode => Notmuch::MODE_READ_ONLY}]) => DB
*
ret = notmuch_database_open (path, mode, &database);
notmuch_rb_status_raise (ret);
- DATA_PTR (self) = database;
+ DATA_PTR (self) = notmuch_rb_object_create (database, "notmuch_rb_database");
return self;
}
VALUE
notmuch_rb_database_close (VALUE self)
{
+ notmuch_database_t *db;
notmuch_status_t ret;
- ret = notmuch_rb_object_destroy (self, ¬much_rb_database_type);
+
+ Data_Get_Notmuch_Database (self, db);
+
+ ret = notmuch_database_close (db);
notmuch_rb_status_raise (ret);
return Qnil;