diff --git a/src/main.cpp b/src/main.cpp index a31818ba874..13df678403f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -310,7 +310,10 @@ int main(int argc, char *argv[]) { // Break out of the main loop shutdown_event->raise(true); - system_tray::end_tray(); + + if (tray_is_enabled && config::sunshine.system_tray) { + system_tray::end_tray(); + } display_device_deinit_guard = nullptr; }); @@ -327,7 +330,10 @@ int main(int argc, char *argv[]) { // Break out of the main loop shutdown_event->raise(true); - system_tray::end_tray(); + + if (tray_is_enabled && config::sunshine.system_tray) { + system_tray::end_tray(); + } display_device_deinit_guard = nullptr; });