From bdfadb1cdcc4146d9879a156f9617e509989293e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 14 Dec 2025 19:11:13 -0600 Subject: [PATCH] Let the streaming session handle exiting on SIGTERM --- app/main.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index 22d2bc10..5d0b827d 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -345,10 +345,16 @@ int SDLCALL signalHandlerThread(void* data) Session* session; switch (sig) { case SIGINT: - // If we get a SIGINT, we'll interrupt the current ongoing activity. - // If we're streaming, that will take you back to the Qt window. + case SIGTERM: + // Check if we have an active streaming session session = Session::get(); if (session != nullptr) { + if (sig == SIGTERM) { + // If this is a SIGTERM, set the flag to quit + session->setShouldExitAfterQuit(); + } + + // Stop the streaming session session->interrupt(); } else { @@ -357,15 +363,6 @@ int SDLCALL signalHandlerThread(void* data) } 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: Q_UNREACHABLE(); }