[host] platform: Close the exitEvent when done

This commit is contained in:
Geoffrey McRae 2023-11-12 05:59:14 +11:00
parent ba8075a9fd
commit 7bcad37568

View File

@ -558,10 +558,14 @@ bool app_init(void)
}
}
if (exitEvent &&
!RegisterWaitForSingleObject(&app.exitWait, exitEvent, exitEventCallback, NULL,
INFINITE, WT_EXECUTEONLYONCE))
DEBUG_WINERROR("Failed to register wait for exit event", GetLastError());
if (exitEvent)
{
if (!RegisterWaitForSingleObject(
&app.exitWait, exitEvent, exitEventCallback, NULL,
INFINITE, WT_EXECUTEONLYONCE))
DEBUG_WINERROR("Failed to register wait for exit event", GetLastError());
CloseHandle(exitEvent);
}
return true;
}