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