diff --git a/host/platform/Windows/src/platform.c b/host/platform/Windows/src/platform.c index 45edffe7..0ce24450 100644 --- a/host/platform/Windows/src/platform.c +++ b/host/platform/Windows/src/platform.c @@ -517,9 +517,10 @@ bool app_init(void) } } - if (!RegisterWaitForSingleObject(&app.exitWait, exitEvent, exitEventCallback, NULL, + if (exitEvent && + !RegisterWaitForSingleObject(&app.exitWait, exitEvent, exitEventCallback, NULL, INFINITE, WT_EXECUTEONLYONCE)) - DEBUG_WINERROR("Failed to create register wait for exit event", GetLastError()); + DEBUG_WINERROR("Failed to register wait for exit event", GetLastError()); return true; }