database error
[notmuch-archives.git] / 1b / 37ebb091cf4e53d0ff722d3d7c2c7df7433d48
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 145E7431FAF\r
6         for <notmuch@notmuchmail.org>; Mon, 23 Apr 2012 05:44:27 -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.799\r
10 X-Spam-Level: \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 FFvzJmJZY51t for <notmuch@notmuchmail.org>;\r
17         Mon, 23 Apr 2012 05:44:25 -0700 (PDT)\r
18 Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com\r
19         [209.85.217.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 BE624431FAE\r
22         for <notmuch@notmuchmail.org>; Mon, 23 Apr 2012 05:44:24 -0700 (PDT)\r
23 Received: by lbdb5 with SMTP id b5so6233625lbd.26\r
24         for <notmuch@notmuchmail.org>; Mon, 23 Apr 2012 05:44:23 -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=I/q6NbBjo8CEAfJdLNLV3NIyJGzL4UjDw0o4VOBnl33LBZQsmPm3D/gfYl3unvueDL\r
29         L4uDc0o6tMyEXsz7nF0CnczHoOHqXxZhtqaqORZLdGI2MFK6U9olKRwmVjqsmtJ3frbW\r
30         D9y7RpPKpaX0WIid+0sKmb7p5ByQtiqLQPUm0JxvFaJz8gXax87G3/bqH9DWQaTaBjzw\r
31         B+0ubw8gJuAh6H6YjlvQa+SIIPZA8J9oHNVqbpnMD3Y+SKtAQgLAIfRlFgNuGcUQBMIh\r
32         bVAx3WLZyAxrwi++ExkviYwd4MbnWMYEEMcHKMSKE2STy/zLKQLezd5ZXmwHtmcEO1BX\r
33         U14g==\r
34 Received: by 10.112.98.200 with SMTP id ek8mr5804798lbb.32.1335185062968;\r
35         Mon, 23 Apr 2012 05:44:22 -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 oi3sm15538630lab.12.2012.04.23.05.44.21\r
38         (version=TLSv1/SSLv3 cipher=OTHER);\r
39         Mon, 23 Apr 2012 05:44:22 -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:43:52 +0300\r
44 Message-Id: <1335185032-13075-1-git-send-email-felipe.contreras@gmail.com>\r
45 X-Mailer: git-send-email 1.7.10\r
46 Cc: Ali Polatel <alip@exherbo.org>\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Mon, 23 Apr 2012 12:44:27 -0000\r
60 \r
61 If the Ruby code does not manually close the database, we need to make\r
62 sure it's closed when garbage collected.\r
63 \r
64 In Ruby, users are not _required_ to close, the garbage collector should\r
65 take care of that.\r
66 \r
67 Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
68 ---\r
69  bindings/ruby/database.c |    8 +++++++-\r
70  1 file changed, 7 insertions(+), 1 deletion(-)\r
71 \r
72 diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c\r
73 index 982fd59..7b2ed47 100644\r
74 --- a/bindings/ruby/database.c\r
75 +++ b/bindings/ruby/database.c\r
76 @@ -20,10 +20,16 @@\r
77  \r
78  #include "defs.h"\r
79  \r
80 +static void\r
81 +database_free (void *p)\r
82 +{\r
83 +    notmuch_database_close (p);\r
84 +}\r
85 +\r
86  VALUE\r
87  notmuch_rb_database_alloc (VALUE klass)\r
88  {\r
89 -    return Data_Wrap_Struct (klass, NULL, NULL, NULL);\r
90 +    return Data_Wrap_Struct (klass, NULL, database_free, NULL);\r
91  }\r
92  \r
93  /*\r
94 -- \r
95 1.7.10\r
96 \r