--- /dev/null
+Return-Path: <teythoon@jade-hamburg.de>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id AD361431FAF\r
+ for <notmuch@notmuchmail.org>; Sun, 22 Apr 2012 05:06:34 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id WsqtvR1yIoAI for <notmuch@notmuchmail.org>;\r
+ Sun, 22 Apr 2012 05:06:33 -0700 (PDT)\r
+Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68])\r
+ (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 07229431FAE\r
+ for <notmuch@notmuchmail.org>; Sun, 22 Apr 2012 05:06:33 -0700 (PDT)\r
+Received: from mail.jade-hamburg.de (mail.jade-hamburg.de [85.183.11.228])\r
+ (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by mail.cryptobitch.de (Postfix) with ESMTPSA id 67DEC4D42BD\r
+ for <notmuch@notmuchmail.org>; Sun, 22 Apr 2012 14:06:28 +0200 (CEST)\r
+Received: by mail.jade-hamburg.de (Postfix, from userid 401)\r
+ id D4163DF2A2; Sun, 22 Apr 2012 14:06:27 +0200 (CEST)\r
+Received: from thinkbox.jade-hamburg.de (unknown [10.1.1.153])\r
+ (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
+ (No client certificate requested) (Authenticated sender: teythoon)\r
+ by mail.jade-hamburg.de (Postfix) with ESMTPSA id 96216DF2A0;\r
+ Sun, 22 Apr 2012 14:06:22 +0200 (CEST)\r
+Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.77)\r
+ (envelope-from <teythoon@thinkbox.jade-hamburg.de>)\r
+ id 1SLvYb-00074l-4C; Sun, 22 Apr 2012 14:06:21 +0200\r
+Content-Type: text/plain; charset="utf-8"\r
+MIME-Version: 1.0\r
+Content-Transfer-Encoding: quoted-printable\r
+To: Austin Clements <amdragon@MIT.EDU>, \r
+From: Justus Winter <4winter@informatik.uni-hamburg.de>\r
+In-Reply-To: <20120412170249.GG13549@mit.edu>\r
+References:\r
+ <1332291311-28954-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
+ <1332291311-28954-8-git-send-email-4winter@informatik.uni-hamburg.de>\r
+ <20120412170249.GG13549@mit.edu>\r
+Message-ID: <20120422120620.26225.40778@thinkbox.jade-hamburg.de>\r
+User-Agent: alot/0.3+\r
+Subject: Re: [PATCH 7/7] python: wrap and use notmuch_database_destroy as\r
+ destructor\r
+Date: Sun, 22 Apr 2012 14:06:20 +0200\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 22 Apr 2012 12:06:34 -0000\r
+\r
+Quoting Austin Clements (2012-04-12 19:02:49)\r
+> Quoth Justus Winter on Mar 21 at 1:55 am:\r
+> > Adapt the go bindings to the notmuch_database_close split.\r
+> =\r
+\r
+> Typo.\r
+\r
+Duh >,<\r
+\r
+> > Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>\r
+> > ---\r
+> > bindings/python/notmuch/database.py | 17 +++++++++++++++--\r
+> > 1 files changed, 15 insertions(+), 2 deletions(-)\r
+> > =\r
+\r
+> > diff --git a/bindings/python/notmuch/database.py b/bindings/python/notm=\r
+uch/database.py\r
+> > index 44d40fd..9a1896b 100644\r
+> > --- a/bindings/python/notmuch/database.py\r
+> > +++ b/bindings/python/notmuch/database.py\r
+> > @@ -218,9 +218,22 @@ class Database(object):\r
+> > _close.restype =3D None\r
+> > =\r
+\r
+> > def close(self):\r
+> > - """Close and free the notmuch database if needed"""\r
+> > - if self._db is not None:\r
+> > + '''\r
+> > + Closes the notmuch database.\r
+> > + '''\r
+> > + if self._db:\r
+> > self._close(self._db)\r
+> > +\r
+> > + _destroy =3D nmlib.notmuch_database_destroy\r
+> > + _destroy.argtypes =3D [NotmuchDatabaseP]\r
+> > + _destroy.restype =3D None\r
+> > +\r
+> > + def destroy(self):\r
+> =\r
+\r
+> Should this be __del__? The existing __del__ is certainly wrong with\r
+> this change, since it only closes the database and doesn't free it. I\r
+> think this function is exactly what you want __del__ to be now.\r
+> =\r
+\r
+> (I think it also doesn't make sense to expose notmuch_database_destroy\r
+> as a general, public method since it will free all of the other C\r
+> objects out from under the bindings, resulting in exactly the double\r
+> free-type crashes that you're trying to avoid. It appears that none\r
+> of the other Python classes have a destroy method.)\r
+\r
+Yes, of course...\r
+\r
+I'm going to send an rebased and updated patch series as a follow up\r
+to this message. Thanks for the input everyone :)\r
+\r
+Justus\r