store: catch dtor exception

This commit is contained in:
Dirk-Jan C. Binnema
2022-02-07 22:34:49 +02:00
parent ea3083da2e
commit 43c44cf6cd

View File

@ -136,11 +136,13 @@ struct Store::Private {
} }
~Private() ~Private()
{ try {
g_debug("closing store @ %s", mdata_.database_path.c_str()); g_debug("closing store @ %s", mdata_.database_path.c_str());
if (!read_only_) { if (!read_only_) {
transaction_maybe_commit(true /*force*/); transaction_maybe_commit(true /*force*/);
} }
} catch (...) {
g_critical("caught exception in store dtor");
} }
std::unique_ptr<Xapian::Database> make_xapian_db(const std::string db_path, XapianOpts opts) std::unique_ptr<Xapian::Database> make_xapian_db(const std::string db_path, XapianOpts opts)