mirror of https://github.com/djcb/mu.git
store: catch exceptions in dtor
This commit is contained in:
parent
ff79d2b7d3
commit
650c4c052d
|
@ -132,15 +132,14 @@ struct Store::Private {
|
|||
|
||||
}
|
||||
|
||||
~Private() {
|
||||
~Private() try {
|
||||
LOCKED;
|
||||
if (wdb()) {
|
||||
wdb()->set_metadata (ContactsKey, contacts_.serialize());
|
||||
if (in_transaction_) // auto-commit.
|
||||
wdb()->commit_transaction();
|
||||
}
|
||||
|
||||
}
|
||||
} MU_XAPIAN_CATCH_BLOCK;
|
||||
|
||||
std::shared_ptr<Xapian::Database> db() const {
|
||||
if (!db_)
|
||||
|
|
Loading…
Reference in New Issue