mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-12-03 11:41:46 +00:00
Invoke QCoreApplication::quit() on the main thread
This is required to safely synchronize with the main loop.
This commit is contained in:
1 parent
67dbfddb20
commit
aad0090d97
2 files changed
+11
-3
No files matched your search
+6
-2
@@ -381,8 +381,12 @@ int SDLCALL signalHandlerThread(void* data)
|
|||||||
_Exit(1);
|
_Exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're not streaming, we'll close the whole app
|
// If we're not streaming, we'll close the whole app on the main thread
|
||||||
QCoreApplication::instance()->quit();
|
if (QCoreApplication* app = QCoreApplication::instance()) {
|
||||||
|
QMetaObject::invokeMethod(app, []() {
|
||||||
|
QCoreApplication::quit();
|
||||||
|
}, Qt::QueuedConnection);
|
||||||
|
}
|
||||||
requestedQuit = true;
|
requestedQuit = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1307,7 +1307,11 @@ private:
|
|||||||
|
|
||||||
// Exit the entire program if requested
|
// Exit the entire program if requested
|
||||||
if (m_Session->m_ShouldExit) {
|
if (m_Session->m_ShouldExit) {
|
||||||
QCoreApplication::instance()->quit();
|
if (QCoreApplication* app = QCoreApplication::instance()) {
|
||||||
|
QMetaObject::invokeMethod(app, []() {
|
||||||
|
QCoreApplication::quit();
|
||||||
|
}, Qt::QueuedConnection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user