Re: notmuch-emacs replying produces excessive indenting on multipart/signed or multip...
[notmuch-archives.git] / 1c / d233afee4be1fc1adbdf1e52a7564981dfe42d
1 Return-Path: <adrien@bustany.org>\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 A1447431FAF\r
6         for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 11:41:05 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 8VN2wL5C+E0Z for <notmuch@notmuchmail.org>;\r
16         Wed, 18 Jul 2012 11:41:05 -0700 (PDT)\r
17 Received: from mail.bustany.org (bustany.org [176.31.244.208])\r
18         by olra.theworths.org (Postfix) with ESMTP id DB475431FB6\r
19         for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 11:41:04 -0700 (PDT)\r
20 Received: from localhost.localdomain (91-158-2-79.elisa-laajakaista.fi\r
21         [91.158.2.79])\r
22         by mail.bustany.org (Postfix) with ESMTPSA id BB9521400C3\r
23         for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 20:37:08 +0200 (CEST)\r
24 From: Adrien Bustany <adrien@bustany.org>\r
25 To: notmuch@notmuchmail.org\r
26 Subject: [PATCH 4/7] go: Make Destroy functions safe to call several times\r
27 Date: Wed, 18 Jul 2012 21:34:32 +0300\r
28 Message-Id: <1342636475-16057-5-git-send-email-adrien@bustany.org>\r
29 X-Mailer: git-send-email 1.7.7.6\r
30 In-Reply-To: <1342636475-16057-1-git-send-email-adrien@bustany.org>\r
31 References: <1342636475-16057-1-git-send-email-adrien@bustany.org>\r
32 X-BeenThere: notmuch@notmuchmail.org\r
33 X-Mailman-Version: 2.1.13\r
34 Precedence: list\r
35 List-Id: "Use and development of the notmuch mail system."\r
36         <notmuch.notmuchmail.org>\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
38         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
40 List-Post: <mailto:notmuch@notmuchmail.org>\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
44 X-List-Received-Date: Wed, 18 Jul 2012 18:41:06 -0000\r
45 \r
46 Those methods were already checking if the underlying C object was NULL,\r
47 but they were not setting the pointer to NULL after destroying it.\r
48 ---\r
49  bindings/go/src/notmuch/notmuch.go |    6 ++++++\r
50  1 files changed, 6 insertions(+), 0 deletions(-)\r
51 \r
52 diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go\r
53 index 3f436a0..d8b2739 100644\r
54 --- a/bindings/go/src/notmuch/notmuch.go\r
55 +++ b/bindings/go/src/notmuch/notmuch.go\r
56 @@ -634,6 +634,7 @@ func (self *Query) SearchMessages() *Messages {\r
57  func (self *Query) Destroy() {\r
58         if self.query != nil {\r
59                 C.notmuch_query_destroy(self.query)\r
60 +               self.query = nil\r
61         }\r
62  }\r
63  \r
64 @@ -680,6 +681,7 @@ func (self *Threads) Valid() bool {\r
65  func (self *Threads) Destroy() {\r
66         if self.threads != nil {\r
67                 C.notmuch_threads_destroy(self.threads)\r
68 +               self.threads = nil\r
69         }\r
70  }\r
71  \r
72 @@ -1143,6 +1145,7 @@ func (self *Message) Destroy() {\r
73                 return\r
74         }\r
75         C.notmuch_message_destroy(self.message)\r
76 +       self.message = nil\r
77  }\r
78  \r
79  /* Is the given 'tags' iterator pointing at a valid tag.\r
80 @@ -1214,6 +1217,7 @@ func (self *Tags) Destroy() {\r
81                 return\r
82         }\r
83         C.notmuch_tags_destroy(self.tags)\r
84 +       self.tags = nil\r
85  }\r
86  \r
87  // TODO: wrap notmuch_directory_<fct>\r
88 @@ -1224,6 +1228,7 @@ func (self *Directory) Destroy() {\r
89                 return\r
90         }\r
91         C.notmuch_directory_destroy(self.dir)\r
92 +       self.dir = nil\r
93  }\r
94  \r
95  // TODO: wrap notmuch_filenames_<fct>\r
96 @@ -1242,6 +1247,7 @@ func (self *Filenames) Destroy() {\r
97                 return\r
98         }\r
99         C.notmuch_filenames_destroy(self.fnames)\r
100 +       self.fnames = nil\r
101  }\r
102  \r
103  /* EOF */\r
104 -- \r
105 1.7.7.6\r
106 \r