Re: [PATCH] ruby: make sure the database is closed
authorAli Polatel <alip@exherbo.org>
Mon, 23 Apr 2012 14:04:43 +0000 (17:04 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:40 +0000 (09:46 -0800)
77/5d49972ca4fc9a4d29a5176a1e0f2f10956960 [new file with mode: 0644]

diff --git a/77/5d49972ca4fc9a4d29a5176a1e0f2f10956960 b/77/5d49972ca4fc9a4d29a5176a1e0f2f10956960
new file mode 100644 (file)
index 0000000..07c9da2
--- /dev/null
@@ -0,0 +1,108 @@
+Return-Path: <polatel@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 031F2431FAF\r
+       for <notmuch@notmuchmail.org>; Mon, 23 Apr 2012 07:04:46 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 7pVdRP1tC2ED for <notmuch@notmuchmail.org>;\r
+       Mon, 23 Apr 2012 07:04:46 -0700 (PDT)\r
+Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id D608D431FAE\r
+       for <notmuch@notmuchmail.org>; Mon, 23 Apr 2012 07:04:45 -0700 (PDT)\r
+Received: by bkcjm2 with SMTP id jm2so2098329bkc.26\r
+       for <notmuch@notmuchmail.org>; Mon, 23 Apr 2012 07:04:43 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=mime-version:sender:in-reply-to:references:date\r
+       :x-google-sender-auth:message-id:subject:from:to:cc:content-type\r
+       :content-transfer-encoding;\r
+       bh=aPPfBs8sjhjRzpppRYKZ0CgbdTShcjf3mOXmxAh2aso=;\r
+       b=ji4cApa19MYC404FS7wZOLuzRLWCiuLFcFLUuw9MwBVwp19WSuzazUMAdXxi/SA6zY\r
+       q5+4dC/SkpTNlDFZFSMsa3JVMOKpgiO51o90bsGM60Oq321GTg3JHtp9V1alNLimCGZn\r
+       1sVXuvRmw4gKwPE9v3rway3MZO2WSFsBZYOjJc9pJFV8PIaNzD2IIdC824nusewAag1j\r
+       ZQuBYsJVPlMmaNHvyCJBHrOFfeoBQYZdyPLwtl5U7c3Ckvne9ZnCmSp2l5laLvnjhLCS\r
+       D+OmfMI9OqS1zwy/uvOp8I6DiwcN1Nhut/AuluschsL+u9gjWu7WdLtG5Gm3qWIvrj8C\r
+       Zaag==\r
+MIME-Version: 1.0\r
+Received: by 10.204.154.133 with SMTP id o5mr5146445bkw.100.1335189883129;\r
+       Mon, 23 Apr 2012 07:04:43 -0700 (PDT)\r
+Sender: polatel@gmail.com\r
+Received: by 10.204.123.73 with HTTP; Mon, 23 Apr 2012 07:04:43 -0700 (PDT)\r
+In-Reply-To: <1335185032-13075-1-git-send-email-felipe.contreras@gmail.com>\r
+References: <1335185032-13075-1-git-send-email-felipe.contreras@gmail.com>\r
+Date: Mon, 23 Apr 2012 17:04:43 +0300\r
+X-Google-Sender-Auth: WwD-_Gj6-IaQEn68VdSYjc7dU0M\r
+Message-ID:\r
+ <CADv3eywAvyMuh3vWLwyuf0Ui_kskwp9875pGxCR1GTm7deN9Pg@mail.gmail.com>\r
+Subject: Re: [PATCH] ruby: make sure the database is closed\r
+From: Ali Polatel <alip@exherbo.org>\r
+To: Felipe Contreras <felipe.contreras@gmail.com>\r
+Content-Type: text/plain; charset=ISO-8859-1\r
+Content-Transfer-Encoding: quoted-printable\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 23 Apr 2012 14:04:47 -0000\r
+\r
+2012/4/23 Felipe Contreras <felipe.contreras@gmail.com>:\r
+> If the Ruby code does not manually close the database, we need to make\r
+> sure it's closed when garbage collected.\r
+>\r
+> In Ruby, users are not _required_ to close, the garbage collector should\r
+> take care of that.\r
+>\r
+> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
+> ---\r
+> =A0bindings/ruby/database.c | =A0 =A08 +++++++-\r
+> =A01 file changed, 7 insertions(+), 1 deletion(-)\r
+>\r
+> diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c\r
+> index 982fd59..7b2ed47 100644\r
+> --- a/bindings/ruby/database.c\r
+> +++ b/bindings/ruby/database.c\r
+> @@ -20,10 +20,16 @@\r
+>\r
+> =A0#include "defs.h"\r
+>\r
+> +static void\r
+> +database_free (void *p)\r
+> +{\r
+> + =A0 =A0notmuch_database_close (p);\r
+> +}\r
+> +\r
+> =A0VALUE\r
+> =A0notmuch_rb_database_alloc (VALUE klass)\r
+> =A0{\r
+> - =A0 =A0return Data_Wrap_Struct (klass, NULL, NULL, NULL);\r
+> + =A0 =A0return Data_Wrap_Struct (klass, NULL, database_free, NULL);\r
+> =A0}\r
+>\r
+> =A0/*\r
+> --\r
+> 1.7.10\r
+>\r
+\r
+I'd rather not do this.\r
+Please read: http://comments.gmane.org/gmane.comp.lang.ruby.general/320324\r
+\r
+        -alip\r