query: bind queries to database objects
authorFelipe Contreras <felipe.contreras@gmail.com>
Mon, 30 Sep 2013 16:04:21 +0000 (11:04 -0500)
committerFelipe Contreras <felipe.contreras@gmail.com>
Sat, 2 Nov 2013 13:20:01 +0000 (07:20 -0600)
The queries don't really work after a database is closed, and we would
like them to be freed if the database is destroyed.

Acknowledged-by: David Bremner <david@tethera.net>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
lib/query.cc

index 69668a451ac7570481792ab5aa4cc81a132f8581..ec60e2e45c01226a9ed326b8af22f1add8b77c8b 100644 (file)
@@ -80,7 +80,7 @@ notmuch_query_create (notmuch_database_t *notmuch,
     if (_debug_query ())
        fprintf (stderr, "Query string is:\n%s\n", query_string);
 
     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;
 
     if (unlikely (query == NULL))
        return NULL;