Prevent crash if focus widget gets deleted during saving

* Fixes #4966
This commit is contained in:
Jonathan White 2020-07-09 21:36:31 -04:00
parent 4a917d171d
commit e02a63b061

View File

@ -1813,7 +1813,7 @@ bool DatabaseWidget::save()
m_blockAutoSave = true; m_blockAutoSave = true;
++m_saveAttempts; ++m_saveAttempts;
auto focusWidget = qApp->focusWidget(); QPointer<QWidget> focusWidget(qApp->focusWidget());
// TODO: Make this async // TODO: Make this async
// Lock out interactions // Lock out interactions
@ -1887,7 +1887,7 @@ bool DatabaseWidget::saveAs()
bool ok = false; bool ok = false;
if (!newFilePath.isEmpty()) { if (!newFilePath.isEmpty()) {
auto focusWidget = qApp->focusWidget(); QPointer<QWidget> focusWidget(qApp->focusWidget());
// Lock out interactions // Lock out interactions
m_entryView->setDisabled(true); m_entryView->setDisabled(true);