void
notmuch_database_close (notmuch_database_t *notmuch)
{
+ notmuch->xapian_db->flush ();
+
delete notmuch->query_parser;
delete notmuch->xapian_db;
talloc_free (notmuch);
const char *from, *to, *subject, *old_filename;
char *message_id;
+ if (message_ret)
+ *message_ret = NULL;
+
message_file = notmuch_message_file_open (filename);
if (message_file == NULL) {
ret = NOTMUCH_STATUS_FILE_ERROR;
DONE:
if (message) {
- if (message_ret)
+ if (ret == NOTMUCH_STATUS_SUCCESS && message_ret)
*message_ret = message;
else
notmuch_message_destroy (message);