diff options
Diffstat (limited to 'src/ui/GpgFrontendUIInit.cpp')
-rw-r--r-- | src/ui/GpgFrontendUIInit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/GpgFrontendUIInit.cpp b/src/ui/GpgFrontendUIInit.cpp index 1ee59d12..55d934bd 100644 --- a/src/ui/GpgFrontendUIInit.cpp +++ b/src/ui/GpgFrontendUIInit.cpp @@ -217,7 +217,8 @@ void WaitingAllInitializationFinished() { auto RunGpgFrontendUI(QApplication* app) -> int { // create main window and show it - auto* main_window = new GpgFrontend::UI::MainWindow(); + auto main_window = QSharedPointer<GpgFrontend::UI::MainWindow>::create(); + main_window->setAttribute(Qt::WA_DeleteOnClose, false); // pre-check, if application need to restart if (CommonUtils::GetInstance()->IsApplicationNeedRestart()) { @@ -233,7 +234,6 @@ auto RunGpgFrontendUI(QApplication* app) -> int { // show main windows main_window->show(); - // start the main event loop return QApplication::exec(); } |