mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 22:23:31 +00:00
Let the streaming session handle exiting on SIGTERM
This commit is contained in:
+8
-11
@@ -345,10 +345,16 @@ int SDLCALL signalHandlerThread(void* data)
|
|||||||
Session* session;
|
Session* session;
|
||||||
switch (sig) {
|
switch (sig) {
|
||||||
case SIGINT:
|
case SIGINT:
|
||||||
// If we get a SIGINT, we'll interrupt the current ongoing activity.
|
case SIGTERM:
|
||||||
// If we're streaming, that will take you back to the Qt window.
|
// Check if we have an active streaming session
|
||||||
session = Session::get();
|
session = Session::get();
|
||||||
if (session != nullptr) {
|
if (session != nullptr) {
|
||||||
|
if (sig == SIGTERM) {
|
||||||
|
// If this is a SIGTERM, set the flag to quit
|
||||||
|
session->setShouldExitAfterQuit();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stop the streaming session
|
||||||
session->interrupt();
|
session->interrupt();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -357,15 +363,6 @@ int SDLCALL signalHandlerThread(void* data)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SIGTERM:
|
|
||||||
// If we get a SIGTERM, we'll terminate everything.
|
|
||||||
session = Session::get();
|
|
||||||
if (session != nullptr) {
|
|
||||||
session->interrupt();
|
|
||||||
}
|
|
||||||
QCoreApplication::instance()->quit();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user