diff options
author | Jonathan White <support@dmapps.us> | 2020-07-10 04:36:31 +0300 |
---|---|---|
committer | Jonathan White <support@dmapps.us> | 2020-07-18 16:15:45 +0300 |
commit | e02a63b0616d75c5d6b4f8894d3b25e8b732f784 (patch) | |
tree | 50bff68bd5a2043113d422e89f9e90f5286ffe54 /src | |
parent | 4a917d171d156812ed24320c6de727667ddcabaf (diff) |
Prevent crash if focus widget gets deleted during saving
* Fixes #4966
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/DatabaseWidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 61f2b2163..042e2a561 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -1813,7 +1813,7 @@ bool DatabaseWidget::save() m_blockAutoSave = true; ++m_saveAttempts; - auto focusWidget = qApp->focusWidget(); + QPointer<QWidget> focusWidget(qApp->focusWidget()); // TODO: Make this async // Lock out interactions @@ -1887,7 +1887,7 @@ bool DatabaseWidget::saveAs() bool ok = false; if (!newFilePath.isEmpty()) { - auto focusWidget = qApp->focusWidget(); + QPointer<QWidget> focusWidget(qApp->focusWidget()); // Lock out interactions m_entryView->setDisabled(true); |