Fix crash on logout

This commit is contained in:
Nicolas Werner 2021-11-01 22:35:32 +01:00
parent 2aabe9dcac
commit 417cc07172
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
1 changed files with 25 additions and 23 deletions

View File

@ -969,6 +969,7 @@ Cache::nextBatchToken()
void
Cache::deleteData()
{
if (this->databaseReady_) {
this->databaseReady_ = false;
// TODO: We need to remove the env_ while not accepting new requests.
lmdb::dbi_close(env_, syncStateDb_);
@ -998,6 +999,7 @@ Cache::deleteData()
deleteSecret(mtx::secret_storage::secrets::cross_signing_user_signing);
deleteSecret(mtx::secret_storage::secrets::cross_signing_self_signing);
deleteSecret("pickle_secret", true);
}
}
//! migrates db to the current format