From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Wed, 29 Feb 2012 09:19:17 +0000 (+0100) Subject: [PATCH] Actually close the xapian database in notmuch_database_close X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=6ff83fbb198abc593728e8327158a5f116d7a9b3;p=notmuch-archives.git [PATCH] Actually close the xapian database in notmuch_database_close --- diff --git a/2e/a0ae91e5ddd2efef244f75953f0553f7752558 b/2e/a0ae91e5ddd2efef244f75953f0553f7752558 new file mode 100644 index 000000000..bc5f6bdc3 --- /dev/null +++ b/2e/a0ae91e5ddd2efef244f75953f0553f7752558 @@ -0,0 +1,89 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 72F21431FD5 + for ; Wed, 29 Feb 2012 01:19:29 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id cW1vGOvghw4T for ; + Wed, 29 Feb 2012 01:19:28 -0800 (PST) +Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id E01F1431FAE + for ; Wed, 29 Feb 2012 01:19:27 -0800 (PST) +Received: from mail.jade-hamburg.de (unknown [85.183.11.228]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.cryptobitch.de (Postfix) with ESMTPSA id 225494F2EC9 + for ; Wed, 29 Feb 2012 10:19:26 +0100 (CET) +Received: by mail.jade-hamburg.de (Postfix, from userid 401) + id 64B9BDF2A8; Wed, 29 Feb 2012 10:19:25 +0100 (CET) +Received: from thinkbox.jade-hamburg.de (unknown [10.1.1.153]) + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) (Authenticated sender: teythoon) + by mail.jade-hamburg.de (Postfix) with ESMTPSA id 689DEDF2A3; + Wed, 29 Feb 2012 10:19:23 +0100 (CET) +Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.77) + (envelope-from ) + id 1S2fgw-00068R-Kq; Wed, 29 Feb 2012 10:19:22 +0100 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +To: notmuch@notmuchmail.org +Subject: [PATCH] Actually close the xapian database in notmuch_database_close +Date: Wed, 29 Feb 2012 10:19:17 +0100 +Message-Id: + <1330507157-22859-2-git-send-email-4winter@informatik.uni-hamburg.de> +X-Mailer: git-send-email 1.7.9 +In-Reply-To: + <1330507157-22859-1-git-send-email-4winter@informatik.uni-hamburg.de> +References: + <1330507157-22859-1-git-send-email-4winter@informatik.uni-hamburg.de> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 29 Feb 2012 09:19:29 -0000 + +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 +