From 134c263e939f6a52944fa641f4b5016e20e21195 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Tue, 1 Oct 2013 11:28:41 +1900 Subject: [PATCH] [PATCH 1/3] query: bind queries to database objects --- 24/eb3857af858ccea18dd622e39e8dac9c9bb1aa | 86 +++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 24/eb3857af858ccea18dd622e39e8dac9c9bb1aa diff --git a/24/eb3857af858ccea18dd622e39e8dac9c9bb1aa b/24/eb3857af858ccea18dd622e39e8dac9c9bb1aa new file mode 100644 index 000000000..f9d8c05f5 --- /dev/null +++ b/24/eb3857af858ccea18dd622e39e8dac9c9bb1aa @@ -0,0 +1,86 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1AA48431FD2 + for ; Mon, 30 Sep 2013 09:34:40 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id DYhJbRycu0zX for ; + Mon, 30 Sep 2013 09:34:31 -0700 (PDT) +Received: from mail-oa0-f53.google.com (mail-oa0-f53.google.com + [209.85.219.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id D6AEF431FC3 + for ; Mon, 30 Sep 2013 09:34:31 -0700 (PDT) +Received: by mail-oa0-f53.google.com with SMTP id i7so3914738oag.12 + for ; Mon, 30 Sep 2013 09:34:31 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=yW+raQgoZF48FtmFumIJgRnlD9NH5puf6iM9+tUDtF4=; + b=LEoI0LvJ9QZCCA3ZMK1dRf14tYTcQLhDBxlVZIjNg0unj7tJqyBhVTXB57L+aSOJTJ + VZRl4C/raEgS6W4pFVT4b2Y4zAUH8liHGTZZrF8AkoTn+csCrQA37iKJhhA6DN2z8sI2 + kUTPeQl/Gt2EbQXHRi16eS3MTngT38cUrpWvZBsmBJl2O6A/sQgDeYmY+JTcQrSyzHUA + EYChYz/BMZ/UsnUahrbIP9GAj46lWbE2bI3xRfY/S5MJWmXp5fg3Ompj/wVhUfRm+Y6c + eg/voDh4fU2AtGwoa6pu54FbPCbZ0YCMblH4L58qFkwicnwbq3M1iNNxxK1MxyxWeVY8 + yqSA== +X-Received: by 10.60.160.197 with SMTP id xm5mr1403948oeb.53.1380558871445; + Mon, 30 Sep 2013 09:34:31 -0700 (PDT) +Received: from localhost (187-162-140-241.static.axtel.net. [187.162.140.241]) + by mx.google.com with ESMTPSA id + rl1sm1967045oeb.7.1969.12.31.16.00.00 + (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); + Mon, 30 Sep 2013 09:34:30 -0700 (PDT) +From: Felipe Contreras +To: notmuch@notmuchmail.org +Subject: [PATCH 1/3] query: bind queries to database objects +Date: Mon, 30 Sep 2013 11:28:41 -0500 +Message-Id: <1380558523-6913-2-git-send-email-felipe.contreras@gmail.com> +X-Mailer: git-send-email 1.8.4-fc +In-Reply-To: <1380558523-6913-1-git-send-email-felipe.contreras@gmail.com> +References: <1380558523-6913-1-git-send-email-felipe.contreras@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 30 Sep 2013 16:34:40 -0000 + +The queries don't really work after a database is closed, and we would +like them to be freed if the database is destroyed. + +Signed-off-by: Felipe Contreras +--- + lib/query.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/query.cc b/lib/query.cc +index 69668a4..ec60e2e 100644 +--- a/lib/query.cc ++++ b/lib/query.cc +@@ -80,7 +80,7 @@ notmuch_query_create (notmuch_database_t *notmuch, + if (_debug_query ()) + fprintf (stderr, "Query string is:\n%s\n", query_string); + +- query = talloc (NULL, notmuch_query_t); ++ query = talloc (notmuch, notmuch_query_t); + if (unlikely (query == NULL)) + return NULL; + +-- +1.8.4-fc + -- 2.26.2