]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch_database_close: Explicitly flush the Xapian database.
authorCarl Worth <cworth@cworth.org>
Tue, 27 Oct 2009 23:17:22 +0000 (16:17 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 27 Oct 2009 23:17:22 +0000 (16:17 -0700)
This would have helped with the recent bug causing "notmuch new"
to not record any results in the database. I'm not sure why
the explicit flush would be required, (shouldn't the destructor
always ensure that things flush?), but perhaps some outstanding
references from the leak prevented that.

In any case, an explicit flush on close() seems to make sense.

database.cc

index 9831d79cdf912f50da160289268c1db504d6d836..8d477eca069abb7e3d1619d5881d3b3ad8d44469 100644 (file)
@@ -505,6 +505,8 @@ notmuch_database_open (const char *path)
 void
 notmuch_database_close (notmuch_database_t *notmuch)
 {
 void
 notmuch_database_close (notmuch_database_t *notmuch)
 {
+    notmuch->xapian_db->flush ();
+
     delete notmuch->query_parser;
     delete notmuch->xapian_db;
     talloc_free (notmuch);
     delete notmuch->query_parser;
     delete notmuch->xapian_db;
     talloc_free (notmuch);