[host] windows: don't register exit event when none exists

This commit is contained in:
Quantum authored and Geoffrey McRae committed 2021-09-04 13:25:06 +10:00
1 parent ac926e4458
commit 286da11172
1 file changed
+3 -2
+3 -2
View File
@@ -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;
}