[PATCH] Actually close the xapian database in notmuch_database_close

Subject: [PATCH] Actually close the xapian database in notmuch_database_close

Date: Wed, 29 Feb 2012 10:19:17 +0100

To: notmuch@notmuchmail.org

Cc:

From: Justus Winter


Formerly the xapian database object was deleted and closed in its
destructor once the object was garbage collected. Explicitly call
close() so that the database and the associated lock is released
immediately.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
---
 lib/database.cc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/database.cc b/lib/database.cc
index 5efa85e..79cf375 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -726,6 +726,10 @@ notmuch_database_close (notmuch_database_t *notmuch)
 	}
     }
 
+    if (notmuch->xapian_db != NULL) {
+	notmuch->xapian_db->close();
+    }
+
     delete notmuch->term_gen;
     delete notmuch->query_parser;
     delete notmuch->xapian_db;
-- 
1.7.9


Thread: