aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar David Bremner <bremner@debian.org>2012-03-03 11:56:36 -0400
committerGravatar David Bremner <bremner@debian.org>2012-03-03 11:56:36 -0400
commitad6a6edb38e428f7bbcd81b49fd2ef1e5197f8c7 (patch)
tree4130d19b8e80b499685039c272cf081bd734f3d3 /lib
parent1aa4abe7a1398d19336ed436735fd1bf5eea5e06 (diff)
parentcfc5f1059aa16753cba610c41601cacc97260e08 (diff)
Merge branch 'release'
Diffstat (limited to 'lib')
-rw-r--r--lib/database.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/database.cc b/lib/database.cc
index 5efa85eb..8f8df1a1 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -726,6 +726,17 @@ notmuch_database_close (notmuch_database_t *notmuch)
}
}
+ /* Many Xapian objects (and thus notmuch objects) hold references to
+ * the database, so merely deleting the database may not suffice to
+ * close it. Thus, we explicitly close it here. */
+ if (notmuch->xapian_db != NULL) {
+ try {
+ notmuch->xapian_db->close();
+ } catch (const Xapian::Error &error) {
+ /* do nothing */
+ }
+ }
+
delete notmuch->term_gen;
delete notmuch->query_parser;
delete notmuch->xapian_db;