Fix crash when trying to close database during unlock

* Fix #7239 - prevent closing the database widget if the open dialog is still unlocking the database. This problem became slightly worse with quick unlock.

With this fix, if the user tries to close the database during unlock we will just ignore that request.
This commit is contained in:
Jonathan White 2022-06-12 16:35:42 -04:00
parent 6cb6f1f007
commit b86c3e64ec
3 changed files with 11 additions and 2 deletions

View file

@ -1565,12 +1565,12 @@ Group* DatabaseWidget::currentGroup() const
void DatabaseWidget::closeEvent(QCloseEvent* event)
{
if (!isLocked() && !lock()) {
if (!lock() || m_databaseOpenWidget->unlockingDatabase()) {
event->ignore();
return;
}
m_databaseOpenWidget->resetQuickUnlock();
m_databaseOpenWidget->resetQuickUnlock();
event->accept();
}