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

This commit is contained in:
Quantum 2021-09-01 05:55:53 -04:00 committed by Geoffrey McRae
parent ac926e4458
commit 286da11172

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;
}