store: catch exceptions in dtor
This commit is contained in:
@ -132,15 +132,14 @@ struct Store::Private {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~Private() {
|
~Private() try {
|
||||||
LOCKED;
|
LOCKED;
|
||||||
if (wdb()) {
|
if (wdb()) {
|
||||||
wdb()->set_metadata (ContactsKey, contacts_.serialize());
|
wdb()->set_metadata (ContactsKey, contacts_.serialize());
|
||||||
if (in_transaction_) // auto-commit.
|
if (in_transaction_) // auto-commit.
|
||||||
wdb()->commit_transaction();
|
wdb()->commit_transaction();
|
||||||
}
|
}
|
||||||
|
} MU_XAPIAN_CATCH_BLOCK;
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<Xapian::Database> db() const {
|
std::shared_ptr<Xapian::Database> db() const {
|
||||||
if (!db_)
|
if (!db_)
|
||||||
|
|||||||
Reference in New Issue
Block a user