From cfd78b5ce7d7f830d7be4cb0b4f8b2e5121eb4d4 Mon Sep 17 00:00:00 2001 From: Elia Zammuto Date: Wed, 4 Oct 2023 15:25:38 +0000 Subject: [PATCH] Fix shutdown when called from tray callback (#1691) --- src/system_tray.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/system_tray.cpp b/src/system_tray.cpp index cab3ee9b72f..95eb9a7e41f 100644 --- a/src/system_tray.cpp +++ b/src/system_tray.cpp @@ -115,11 +115,12 @@ namespace system_tray { // If we're running in a service, return a special status to // tell it to terminate too, otherwise it will just respawn us. if (GetConsoleWindow() == NULL) { - lifetime::exit_sunshine(ERROR_SHUTDOWN_IN_PROGRESS, false); + lifetime::exit_sunshine(ERROR_SHUTDOWN_IN_PROGRESS, true); + return; } #endif - lifetime::exit_sunshine(0, false); + lifetime::exit_sunshine(0, true); } // Tray menu