mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 17:40:47 +03:00
Fix crash on logout
This commit is contained in:
parent
2aabe9dcac
commit
417cc07172
1 changed files with 25 additions and 23 deletions
|
@ -969,35 +969,37 @@ Cache::nextBatchToken()
|
|||
void
|
||||
Cache::deleteData()
|
||||
{
|
||||
this->databaseReady_ = false;
|
||||
// TODO: We need to remove the env_ while not accepting new requests.
|
||||
lmdb::dbi_close(env_, syncStateDb_);
|
||||
lmdb::dbi_close(env_, roomsDb_);
|
||||
lmdb::dbi_close(env_, invitesDb_);
|
||||
lmdb::dbi_close(env_, readReceiptsDb_);
|
||||
lmdb::dbi_close(env_, notificationsDb_);
|
||||
if (this->databaseReady_) {
|
||||
this->databaseReady_ = false;
|
||||
// TODO: We need to remove the env_ while not accepting new requests.
|
||||
lmdb::dbi_close(env_, syncStateDb_);
|
||||
lmdb::dbi_close(env_, roomsDb_);
|
||||
lmdb::dbi_close(env_, invitesDb_);
|
||||
lmdb::dbi_close(env_, readReceiptsDb_);
|
||||
lmdb::dbi_close(env_, notificationsDb_);
|
||||
|
||||
lmdb::dbi_close(env_, devicesDb_);
|
||||
lmdb::dbi_close(env_, deviceKeysDb_);
|
||||
lmdb::dbi_close(env_, devicesDb_);
|
||||
lmdb::dbi_close(env_, deviceKeysDb_);
|
||||
|
||||
lmdb::dbi_close(env_, inboundMegolmSessionDb_);
|
||||
lmdb::dbi_close(env_, outboundMegolmSessionDb_);
|
||||
lmdb::dbi_close(env_, megolmSessionDataDb_);
|
||||
lmdb::dbi_close(env_, inboundMegolmSessionDb_);
|
||||
lmdb::dbi_close(env_, outboundMegolmSessionDb_);
|
||||
lmdb::dbi_close(env_, megolmSessionDataDb_);
|
||||
|
||||
env_.close();
|
||||
env_.close();
|
||||
|
||||
verification_storage.status.clear();
|
||||
verification_storage.status.clear();
|
||||
|
||||
if (!cacheDirectory_.isEmpty()) {
|
||||
QDir(cacheDirectory_).removeRecursively();
|
||||
nhlog::db()->info("deleted cache files from disk");
|
||||
if (!cacheDirectory_.isEmpty()) {
|
||||
QDir(cacheDirectory_).removeRecursively();
|
||||
nhlog::db()->info("deleted cache files from disk");
|
||||
}
|
||||
|
||||
deleteSecret(mtx::secret_storage::secrets::megolm_backup_v1);
|
||||
deleteSecret(mtx::secret_storage::secrets::cross_signing_master);
|
||||
deleteSecret(mtx::secret_storage::secrets::cross_signing_user_signing);
|
||||
deleteSecret(mtx::secret_storage::secrets::cross_signing_self_signing);
|
||||
deleteSecret("pickle_secret", true);
|
||||
}
|
||||
|
||||
deleteSecret(mtx::secret_storage::secrets::megolm_backup_v1);
|
||||
deleteSecret(mtx::secret_storage::secrets::cross_signing_master);
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue