1 Return-Path: <felipe.contreras@gmail.com>
\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 20E02431FAF
\r
6 for <notmuch@notmuchmail.org>; Mon, 23 Apr 2012 05:36:35 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id CA1nX8JehwqI for <notmuch@notmuchmail.org>;
\r
17 Mon, 23 Apr 2012 05:36:34 -0700 (PDT)
\r
18 Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com
\r
19 [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 5E5BC431FAE
\r
22 for <notmuch@notmuchmail.org>; Mon, 23 Apr 2012 05:36:34 -0700 (PDT)
\r
23 Received: by eaa1 with SMTP id 1so4845805eaa.26
\r
24 for <notmuch@notmuchmail.org>; Mon, 23 Apr 2012 05:36:33 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
26 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
\r
27 :cc:content-type:content-transfer-encoding;
\r
28 bh=sS9SukCX68dPRsX6RcHM/nvXw/fnLOy6II5Njn4RAuk=;
\r
29 b=BvpA2yyuI45RPtdhvXhHNWasLjEb0LNFWhlElSfuUEUlpXcGMTXJuyQVMyoyMBCl/O
\r
30 XB7yqlsZQW5wuK4xmtQa4i72oN5xh/B7MZev1WGCHPSdAO4Hy69WKVuxot4V9TGAu/Mr
\r
31 qrhkIqxYEPfN0rUWzpcaLysmuhiuxUAs9A7iYbkzwsaCgpQkP4tx6nIuAKqg+q7IROiF
\r
32 LMAxGfaG0m1CfQXDfxePX077d8JJkIdNllT9ZF9wb6WNDp1mczOkhoTtME0mlmuWVGYj
\r
33 5LoOVo4MAij6S+HkgtW0dshfSaQYU1ef5JoZw4A6g1u/JfokF2C9QQbBYna3U/Nusrnd
\r
36 Received: by 10.14.96.129 with SMTP id r1mr2524813eef.86.1335184593098; Mon,
\r
37 23 Apr 2012 05:36:33 -0700 (PDT)
\r
38 Received: by 10.213.103.18 with HTTP; Mon, 23 Apr 2012 05:36:33 -0700 (PDT)
\r
40 <1335096477-27537-6-git-send-email-4winter@informatik.uni-hamburg.de>
\r
41 References: <20120422120620.26225.40778@thinkbox.jade-hamburg.de>
\r
42 <1335096477-27537-1-git-send-email-4winter@informatik.uni-hamburg.de>
\r
43 <1335096477-27537-6-git-send-email-4winter@informatik.uni-hamburg.de>
\r
44 Date: Mon, 23 Apr 2012 15:36:33 +0300
\r
46 <CAMP44s0KHJz6AxUfRjEUk5heOEFVyT2NixpFNb5GZakXaoLAKw@mail.gmail.com>
\r
47 Subject: Re: [PATCH 6/7] ruby: Use notmuch_database_destroy instead of
\r
48 notmuch_database_close
\r
49 From: Felipe Contreras <felipe.contreras@gmail.com>
\r
50 To: Justus Winter <4winter@informatik.uni-hamburg.de>
\r
51 Content-Type: text/plain; charset=UTF-8
\r
52 Content-Transfer-Encoding: quoted-printable
\r
53 Cc: notmuch@notmuchmail.org
\r
54 X-BeenThere: notmuch@notmuchmail.org
\r
55 X-Mailman-Version: 2.1.13
\r
57 List-Id: "Use and development of the notmuch mail system."
\r
58 <notmuch.notmuchmail.org>
\r
59 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
60 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
61 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
62 List-Post: <mailto:notmuch@notmuchmail.org>
\r
63 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
64 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
65 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
66 X-List-Received-Date: Mon, 23 Apr 2012 12:36:35 -0000
\r
70 On Sun, Apr 22, 2012 at 3:07 PM, Justus Winter
\r
71 <4winter@informatik.uni-hamburg.de> wrote:
\r
72 > Adapt the ruby bindings to the notmuch_database_close split.
\r
74 > Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
\r
76 > =C2=A0bindings/ruby/database.c | =C2=A0 =C2=A02 +-
\r
77 > =C2=A01 file changed, 1 insertion(+), 1 deletion(-)
\r
79 > diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c
\r
80 > index 982fd59..ba9a139 100644
\r
81 > --- a/bindings/ruby/database.c
\r
82 > +++ b/bindings/ruby/database.c
\r
83 > @@ -110,7 +110,7 @@ notmuch_rb_database_close (VALUE self)
\r
84 > =C2=A0 =C2=A0 notmuch_database_t *db;
\r
86 > =C2=A0 =C2=A0 Data_Get_Notmuch_Database (self, db);
\r
87 > - =C2=A0 =C2=A0notmuch_database_close (db);
\r
88 > + =C2=A0 =C2=A0notmuch_database_destroy (db);
\r
89 > =C2=A0 =C2=A0 DATA_PTR (self) =3D NULL;
\r
91 > =C2=A0 =C2=A0 return Qnil;
\r
94 I don't think this is the right approach. If database_destroy truly
\r
95 destroys the object, then we would want to do it only at garbage
\r
96 collection, when it's not accessible any more. What if I want to
\r
97 re-use the database from the Ruby code?
\r
99 This would probably be better:
\r
101 -- a/bindings/ruby/database.c
\r
102 +++ b/bindings/ruby/database.c
\r
103 @@ -20,10 +20,16 @@
\r
108 +database_free (void *p)
\r
110 + notmuch_database_destroy (p);
\r
114 notmuch_rb_database_alloc (VALUE klass)
\r
116 - return Data_Wrap_Struct (klass, NULL, NULL, NULL);
\r
117 + return Data_Wrap_Struct (klass, NULL, database_free, NULL);
\r