From db18a14cde40dc24a5f2f2a10cb5b874ca2c8174 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Tue, 26 Jan 2021 23:05:22 -0500 Subject: [PATCH] Ensure app exiting flag is set on logoff/shutdown * Fix #3944 --- src/gui/MainWindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index c4bee6b67..c7df04a69 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -555,6 +555,9 @@ MainWindow::MainWindow() MessageWidget::Error); } + // Properly shutdown on logoff, restart, and shutdown + connect(qApp, &QGuiApplication::commitDataRequest, this, [this] { m_appExitCalled = true; }); + #if defined(KEEPASSXC_BUILD_TYPE_SNAPSHOT) || defined(KEEPASSXC_BUILD_TYPE_PRE_RELEASE) auto* hidePreRelWarn = new QAction(tr("Don't show again for this version"), m_ui->globalMessageWidget); m_ui->globalMessageWidget->addAction(hidePreRelWarn);