Stop the service if the user quits via the tray icon
This commit is contained in:
@@ -301,9 +301,16 @@ ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv) {
|
||||
}
|
||||
break;
|
||||
|
||||
case WAIT_OBJECT_0 + 1:
|
||||
case WAIT_OBJECT_0 + 1: {
|
||||
// Sunshine terminated itself.
|
||||
|
||||
DWORD exit_code;
|
||||
if (GetExitCodeProcess(process_info.hProcess, &exit_code) && exit_code == ERROR_SHUTDOWN_IN_PROGRESS) {
|
||||
// Sunshine is asking for us to shut down, so gracefully stop ourselves.
|
||||
SetEvent(stop_event);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CloseHandle(process_info.hThread);
|
||||
|
||||
Reference in New Issue
Block a user