mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
ruby: handle return status of database close
Throw an exception if notmuch_database_destroy fails.
This commit is contained in:
parent
d81fc4b42d
commit
034102303e
1 changed files with 3 additions and 1 deletions
|
@ -113,11 +113,13 @@ notmuch_rb_database_open (int argc, VALUE *argv, VALUE klass)
|
|||
VALUE
|
||||
notmuch_rb_database_close (VALUE self)
|
||||
{
|
||||
notmuch_status_t ret;
|
||||
notmuch_database_t *db;
|
||||
|
||||
Data_Get_Notmuch_Database (self, db);
|
||||
notmuch_database_destroy (db);
|
||||
ret = notmuch_database_destroy (db);
|
||||
DATA_PTR (self) = NULL;
|
||||
notmuch_rb_status_raise (ret);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue