From 672d0c723832d4b307d3641b5cf31c3c5ac7ec57 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sat, 16 Oct 2021 11:14:23 +0300 Subject: [PATCH] store: don't try to commit when there's no transaction Avoids some error warning. --- lib/mu-store.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mu-store.cc b/lib/mu-store.cc index 7abd3fd3..a3b5c9f9 100644 --- a/lib/mu-store.cc +++ b/lib/mu-store.cc @@ -186,8 +186,10 @@ struct Store::Private { dirtiness_ = 0; if (mdata_.in_memory) return; // not supported in the in-memory backend. - writable_db().commit_transaction(); + if (in_transaction_) + writable_db().commit_transaction(); writable_db().begin_transaction(); + in_transaction_ = true; } MU_XAPIAN_CATCH_BLOCK; void add_synonyms () {