X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fdatabase.cc;h=66ee267fe50ebb89b3e5feda2d4b88089d414800;hb=9b60dc3cd9224eddfe9bc5cf74eeaa5f0d599d04;hp=2b2d8219d29e5e963517b2a9c5219dec56be83dc;hpb=ba0b95f846820b1d71f67731a8c38ac2866c921a;p=notmuch diff --git a/lib/database.cc b/lib/database.cc index 2b2d8219..66ee267f 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -49,6 +49,12 @@ typedef struct { #define STRINGIFY(s) _SUB_STRINGIFY(s) #define _SUB_STRINGIFY(s) #s +#if HAVE_XAPIAN_DB_RETRY_LOCK +#define DB_ACTION (Xapian::DB_CREATE_OR_OPEN | Xapian::DB_RETRY_LOCK) +#else +#define DB_ACTION Xapian::DB_CREATE_OR_OPEN +#endif + /* Here's the current schema for our database (for NOTMUCH_DATABASE_VERSION): * * We currently have three different types of documents (mail, ghost, @@ -939,7 +945,7 @@ notmuch_database_open_verbose (const char *path, if (mode == NOTMUCH_DATABASE_MODE_READ_WRITE) { notmuch->xapian_db = new Xapian::WritableDatabase (xapian_path, - Xapian::DB_CREATE_OR_OPEN); + DB_ACTION); } else { notmuch->xapian_db = new Xapian::Database (xapian_path); } @@ -1107,6 +1113,13 @@ 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; }