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 committed 2024-04-13 07:54:18 -04:00
1 parent f60601fa67
commit 6481ecccd7
5 files changed
+44 -25

No files matched your search

+1 -3
View File
@@ -264,9 +264,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()