Skip to content
Snippets Groups Projects
Commit b963a0bd authored by Water Chika's avatar Water Chika Committed by Andreas Traczyk
Browse files

Avoid infinite loops in MainApplication::cleanup

Change-Id: I910ab554c463a3d91c48c297c6c1ed48202283f9
parent d765fc92
No related branches found
No related tags found
No related merge requests found
......@@ -105,7 +105,7 @@ ScreenInfo::onPhysicalDotsPerInchChanged()
}
MainApplication::MainApplication(int& argc, char** argv)
: QApplication(argc, argv)
: QApplication(argc, argv), isCleanupped(false)
{
const char* qtVersion = qVersion();
qInfo() << "Using Qt runtime version:" << qtVersion;
......@@ -401,7 +401,12 @@ MainApplication::initSystray()
void
MainApplication::cleanup()
{
QApplication::exit(0);
// In Qt 6.5, QApplication::exit(0) will signal aboutToQuit, and aboutToQuit is connected to cleanup
// TODO: delete cleanup.
if (!isCleanupped) {
isCleanupped = true;
QApplication::exit(0);
}
}
#ifdef Q_OS_MACOS
......
......@@ -121,4 +121,6 @@ private:
QScopedPointer<ImageDownloader> imageDownloader_;
ScreenInfo screenInfo_;
bool isCleanupped;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment