diff --git a/src/WindowManager.cpp b/src/WindowManager.cpp index 6cdf92a..541575a 100644 --- a/src/WindowManager.cpp +++ b/src/WindowManager.cpp @@ -85,10 +85,18 @@ void WindowManager::close() { window->close(); } - m_wizard->deleteLater(); - m_splashDialog->deleteLater(); - m_tray->deleteLater(); - m_docsDialog->deleteLater(); + if (m_splashDialog) { + m_splashDialog->deleteLater(); + } + if (m_tray) { + m_tray->deleteLater(); + } + if (m_wizard) { + m_wizard->deleteLater(); + } + if (m_docsDialog) { + m_docsDialog->deleteLater(); + } torManager()->stop(); diff --git a/src/WindowManager.h b/src/WindowManager.h index 8df04c5..b4f10fc 100644 --- a/src/WindowManager.h +++ b/src/WindowManager.h @@ -100,7 +100,7 @@ private: SplashDialog *m_splashDialog = nullptr; DocsDialog *m_docsDialog = nullptr; - QSystemTrayIcon *m_tray; + QSystemTrayIcon *m_tray = nullptr; QMap m_skins;