From 286da11172bcf85baf3d3e9d5334203573094e2d Mon Sep 17 00:00:00 2001 From: Quantum Date: Wed, 1 Sep 2021 05:55:53 -0400 Subject: [PATCH] [host] windows: don't register exit event when none exists --- host/platform/Windows/src/platform.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; }