Fix crash on screen lock or computer sleep

* Fixes #10455
* Fixes #10432
* Fixes #10415

Prevent setting critical key components to nullptr when database data is cleared. This can result in a crash due to race condition between threads.

Added a bunch of asserts to detect this problem and if guards to prevent actual crashes.
This commit is contained in:
Jonathan White 2024-03-17 10:15:15 -04:00
parent 3b8dc028c1
commit a8b60b7b02
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
5 changed files with 44 additions and 25 deletions

View file

@ -270,9 +270,7 @@ void DatabaseOpenWidget::clearForms()
m_ui->hardwareKeyCombo->clear();
toggleQuickUnlockScreen();
QString error;
m_db.reset(new Database());
m_db->open(m_filename, nullptr, &error);
m_db.reset(new Database(m_filename));
}
QSharedPointer<Database> DatabaseOpenWidget::database()