1 Return-Path: <amdragon@mit.edu>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 75F6E431FB6
\r
6 for <notmuch@notmuchmail.org>; Thu, 12 Apr 2012 10:02:52 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id MdwwPoKJOapV for <notmuch@notmuchmail.org>;
\r
16 Thu, 12 Apr 2012 10:02:52 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id CE41B431FAE
\r
20 for <notmuch@notmuchmail.org>; Thu, 12 Apr 2012 10:02:51 -0700 (PDT)
\r
21 X-AuditID: 1209190c-b7fad6d000000920-26-4f870abbf7eb
\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])
\r
23 by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 47.58.02336.BBA078F4; Thu, 12 Apr 2012 13:02:51 -0400 (EDT)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q3CH2pIU022054;
\r
27 Thu, 12 Apr 2012 13:02:51 -0400
\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q3CH2neS025675
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Thu, 12 Apr 2012 13:02:50 -0400 (EDT)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)
\r
35 (envelope-from <amdragon@mit.edu>)
\r
36 id 1SINQ1-0004JP-M2; Thu, 12 Apr 2012 13:02:49 -0400
\r
37 Date: Thu, 12 Apr 2012 13:02:49 -0400
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: Justus Winter <4winter@informatik.uni-hamburg.de>
\r
40 Subject: Re: [PATCH 7/7] python: wrap and use notmuch_database_destroy as
\r
42 Message-ID: <20120412170249.GG13549@mit.edu>
\r
44 <1332291311-28954-1-git-send-email-4winter@informatik.uni-hamburg.de>
\r
45 <1332291311-28954-8-git-send-email-4winter@informatik.uni-hamburg.de>
\r
47 Content-Type: text/plain; charset=us-ascii
\r
48 Content-Disposition: inline
\r
50 <1332291311-28954-8-git-send-email-4winter@informatik.uni-hamburg.de>
\r
51 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
52 X-Brightmail-Tracker:
\r
53 H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IR4hRV1t3N1e5vsPySpMXs1h9MFtdvzmR2
\r
54 YPKYeP40m8ezVbeYA5iiuGxSUnMyy1KL9O0SuDIuXLrLXtDMV7H21UzmBsYDXF2MnBwSAiYS
\r
55 p5q6WSBsMYkL99azdTFycQgJ7GOUWDDjNSOEs4FR4tuyVrAqIYGTTBJXDoVDJJYwSrz7eokZ
\r
56 JMEioCqxq7OPFcRmE9CQ2LZ/OSOILSJgKrHhwQN2EJtZQFri2+9mJhBbWCBM4tH+D2wgNq+A
\r
57 jsTFCeuhts1klGh/eJkRIiEocXLmExaIZi2JG/9eAjVzgA1a/o8DJMwpECSxYN8RsBJRARWJ
\r
58 KSe3sU1gFJqFpHsWku5ZCN0LGJlXMcqm5Fbp5iZm5hSnJusWJyfm5aUW6Rrq5WaW6KWmlG5i
\r
59 BAe2JM8OxjcHlQ4xCnAwKvHwvnzW5i/EmlhWXJl7iFGSg0lJlHc1e7u/EF9SfkplRmJxRnxR
\r
60 aU5q8SFGCQ5mJRHeP4+BynlTEiurUovyYVLSHCxK4rwqWu/8hATSE0tSs1NTC1KLYLIyHBxK
\r
61 ErwuwAgWEixKTU+tSMvMKUFIM3FwggznARpuDVLDW1yQmFucmQ6RP8WoKCXOqwySEABJZJTm
\r
62 wfXCEs8rRnGgV4R57UGqeIBJC677FdBgJqDBfAogVxeXJCKkpBoYNf29ojr317rmlS0p8z/w
\r
63 eO7N4yE72FxWFkxX+ZRx+uqBpHXq8oW67BeLk/QyGAUfzMvZc3v67avr/voFngy8ErFnwqZp
\r
64 XWr7n5zhvOD9O9efzaBq+hFHAVNe9mslS+p6pWY8erFl+h9jx2O7Tjay3mitnO1kK1pbsHMd
\r
65 0+6jtccOmlrdvjRFWYmlOCPRUIu5qDgRABjs77QXAwAA
\r
66 Cc: notmuch@notmuchmail.org
\r
67 X-BeenThere: notmuch@notmuchmail.org
\r
68 X-Mailman-Version: 2.1.13
\r
70 List-Id: "Use and development of the notmuch mail system."
\r
71 <notmuch.notmuchmail.org>
\r
72 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
73 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
74 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
75 List-Post: <mailto:notmuch@notmuchmail.org>
\r
76 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
77 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
78 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
79 X-List-Received-Date: Thu, 12 Apr 2012 17:02:52 -0000
\r
81 Quoth Justus Winter on Mar 21 at 1:55 am:
\r
82 > Adapt the go bindings to the notmuch_database_close split.
\r
87 > Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
\r
89 > bindings/python/notmuch/database.py | 17 +++++++++++++++--
\r
90 > 1 files changed, 15 insertions(+), 2 deletions(-)
\r
92 > diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py
\r
93 > index 44d40fd..9a1896b 100644
\r
94 > --- a/bindings/python/notmuch/database.py
\r
95 > +++ b/bindings/python/notmuch/database.py
\r
96 > @@ -218,9 +218,22 @@ class Database(object):
\r
97 > _close.restype = None
\r
100 > - """Close and free the notmuch database if needed"""
\r
101 > - if self._db is not None:
\r
103 > + Closes the notmuch database.
\r
106 > self._close(self._db)
\r
108 > + _destroy = nmlib.notmuch_database_destroy
\r
109 > + _destroy.argtypes = [NotmuchDatabaseP]
\r
110 > + _destroy.restype = None
\r
112 > + def destroy(self):
\r
114 Should this be __del__? The existing __del__ is certainly wrong with
\r
115 this change, since it only closes the database and doesn't free it. I
\r
116 think this function is exactly what you want __del__ to be now.
\r
118 (I think it also doesn't make sense to expose notmuch_database_destroy
\r
119 as a general, public method since it will free all of the other C
\r
120 objects out from under the bindings, resulting in exactly the double
\r
121 free-type crashes that you're trying to avoid. It appears that none
\r
122 of the other Python classes have a destroy method.)
\r
125 > + Destroys the notmuch database.
\r
128 > + self._destroy(self._db)
\r
131 > def __enter__(self):
\r