if (config == NULL)
return 1;
- notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
- NOTMUCH_DATABASE_MODE_READ_WRITE);
- if (notmuch == NULL)
+ if (notmuch_database_open (notmuch_config_get_database_path (config),
+ NOTMUCH_DATABASE_MODE_READ_WRITE, ¬much))
return 1;
synchronize_flags = notmuch_config_get_maildir_synchronize_flags (config);
ret = tag_query (ctx, notmuch, query_string, tag_ops, synchronize_flags);
- notmuch_database_close (notmuch);
+ notmuch_database_destroy (notmuch);
return ret;
}