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 7FC8D431FD9
\r
6 for <notmuch@notmuchmail.org>; Mon, 23 Apr 2012 05:48:51 -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=unavailable
\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 boAjadw5OIhC for <notmuch@notmuchmail.org>;
\r
17 Mon, 23 Apr 2012 05:48:51 -0700 (PDT)
\r
18 Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com
\r
19 [209.85.215.53]) (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 52804431FD7
\r
22 for <notmuch@notmuchmail.org>; Mon, 23 Apr 2012 05:48:50 -0700 (PDT)
\r
23 Received: by lahc1 with SMTP id c1so9220121lah.26
\r
24 for <notmuch@notmuchmail.org>; Mon, 23 Apr 2012 05:48:48 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
26 h=from:to:cc:subject:date:message-id:x-mailer;
\r
27 bh=kc5BhnESDswK35XfDdPa6FZJZbNEf/JduoaUlcRarmk=;
\r
28 b=bYRx1WlKPd7gZqeKEGb5kN8+Mh0ay0D8FdokJQRwBorvqyi3Bs3omTOug5caA/QvIu
\r
29 DL+N8l/8Q980ctT7XesGL+gobNfXIf9odx+1xZCbp/+ZWQLPB4/QSfV6LIJh0rutv7Qr
\r
30 My2qNJ/2V1b0WeOXMtTllvY2gxA6S5ophER2BBj5XgoXekPX+cF0vZez+WGIHJyX57mF
\r
31 77BGtHGdmgX4CG5zb8iGWmfDMpF+HcmgW5uHqDHilUzhiMVJzaMJ6Vos8NBPUY+9b3ZZ
\r
32 f93cIIhlq01bo+oSCw+T8kUCmtdCZKBt9LuHHk4ZDwDYtgFR50aXOgQNW7ALOu+sleWY
\r
34 Received: by 10.112.36.66 with SMTP id o2mr7298904lbj.107.1335185328583;
\r
35 Mon, 23 Apr 2012 05:48:48 -0700 (PDT)
\r
36 Received: from localhost (81-197-42-53.elisa-mobile.fi. [81.197.42.53])
\r
37 by mx.google.com with ESMTPS id ox7sm19776217lbb.17.2012.04.23.05.48.47
\r
38 (version=TLSv1/SSLv3 cipher=OTHER);
\r
39 Mon, 23 Apr 2012 05:48:47 -0700 (PDT)
\r
40 From: Felipe Contreras <felipe.contreras@gmail.com>
\r
41 To: notmuch@notmuchmail.org
\r
42 Subject: [PATCH] ruby: make sure the database is closed
\r
43 Date: Mon, 23 Apr 2012 15:48:20 +0300
\r
44 Message-Id: <1335185300-12950-1-git-send-email-felipe.contreras@gmail.com>
\r
45 X-Mailer: git-send-email 1.7.10
\r
46 X-BeenThere: notmuch@notmuchmail.org
\r
47 X-Mailman-Version: 2.1.13
\r
49 List-Id: "Use and development of the notmuch mail system."
\r
50 <notmuch.notmuchmail.org>
\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
54 List-Post: <mailto:notmuch@notmuchmail.org>
\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
58 X-List-Received-Date: Mon, 23 Apr 2012 12:48:51 -0000
\r
60 If the Ruby code does not manually close the database, we need to make
\r
61 sure it's closed when garbage collected.
\r
63 In Ruby, users are not _required_ to close, the garbage collector should
\r
66 Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
\r
68 bindings/ruby/database.c | 8 +++++++-
\r
69 1 file changed, 7 insertions(+), 1 deletion(-)
\r
71 diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c
\r
72 index 982fd59..7b2ed47 100644
\r
73 --- a/bindings/ruby/database.c
\r
74 +++ b/bindings/ruby/database.c
\r
80 +database_free (void *p)
\r
82 + notmuch_database_close (p);
\r
86 notmuch_rb_database_alloc (VALUE klass)
\r
88 - return Data_Wrap_Struct (klass, NULL, NULL, NULL);
\r
89 + return Data_Wrap_Struct (klass, NULL, database_free, NULL);
\r