X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fdatabase.cc;h=386dcd17adc4d0a91ab5eb10479907b254d32187;hp=b954b34cc3be57fd76fe182753f10849685e6371;hb=e0e8586fc72763571f9eafeb831c7bc79a15273d;hpb=e30fa4182fbae7b302d1e90de9f36a8d08a47c1b diff --git a/lib/database.cc b/lib/database.cc index b954b34c..386dcd17 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -644,7 +644,7 @@ parse_references (void *ctx, ref = _parse_message_id (ctx, refs, &refs); if (ref && strcmp (ref, message_id)) { - g_hash_table_insert (hash, ref, NULL); + g_hash_table_add (hash, ref); last_ref = ref; } } @@ -653,7 +653,7 @@ parse_references (void *ctx, * reference to the database. We should avoid making a message * its own parent, thus the above check. */ - return last_ref; + return talloc_strdup(ctx, last_ref); } notmuch_status_t @@ -1030,10 +1030,14 @@ notmuch_database_open_verbose (const char *path, #if HAVE_XAPIAN_FIELD_PROCESSOR /* This currently relies on the query parser to pass anything * with a .. to the range processor */ - notmuch->date_field_processor = new DateFieldProcessor(); - notmuch->query_parser->add_boolean_prefix("date", notmuch->date_field_processor); - notmuch->query_field_processor = new QueryFieldProcessor (*notmuch->query_parser, notmuch); - notmuch->query_parser->add_boolean_prefix("query", notmuch->query_field_processor); + { + Xapian::FieldProcessor * date_fp = new DateFieldProcessor(); + Xapian::FieldProcessor * query_fp = + new QueryFieldProcessor (*notmuch->query_parser, notmuch); + + notmuch->query_parser->add_boolean_prefix("date", date_fp->release ()); + notmuch->query_parser->add_boolean_prefix("query", query_fp->release ()); + } #endif notmuch->last_mod_range_processor = new Xapian::NumberValueRangeProcessor (NOTMUCH_VALUE_LAST_MOD, "lastmod:"); @@ -1126,13 +1130,6 @@ notmuch_database_close (notmuch_database_t *notmuch) delete notmuch->last_mod_range_processor; notmuch->last_mod_range_processor = NULL; -#if HAVE_XAPIAN_FIELD_PROCESSOR - delete notmuch->date_field_processor; - notmuch->date_field_processor = NULL; - delete notmuch->query_field_processor; - notmuch->query_field_processor = NULL; -#endif - return status; }