Commit 22c41e7e authored by Andreas Traczyk's avatar Andreas Traczyk

systray: hide systray icon in QCoreApplication::aboutToQuit

- try to hide the systray icon before lrc dtor to reduce the
  chances of leaving behind an icon in the systray on crash

Change-Id: I9f7ea3644cdaae7d70d11e1ee5703d19bfcfd188
parent f128c337
......@@ -249,9 +249,15 @@ main(int argc, char* argv[])
MainWindow::instance().hide();
}
QObject::connect(&a, &QApplication::aboutToQuit, [&guard] { guard.release(); });
QObject::connect(&a, &QApplication::aboutToQuit,
[&guard] {
GlobalSystemTray::instance().hide();
guard.release();
});
splash->finish(&MainWindow::instance());
splash->deleteLater();
auto ret = a.exec();
LRCInstance::reset();
......@@ -260,9 +266,5 @@ main(int argc, char* argv[])
FreeConsole();
#endif
QCoreApplication::exit();
GlobalSystemTray::instance().deleteLater();
GlobalSystemTray::instance().hide();
return ret;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment