1
0

Windows close handlers handles more closes

This commit is contained in:
Tiger Wang 2014-10-21 13:41:08 +01:00
parent 5089f04cf6
commit 014ebb7fe6

View File

@ -158,12 +158,9 @@ BOOL CtrlHandler(DWORD fdwCtrlType)
cRoot::m_TerminateEventRaised = true;
LOGD("Terminate event raised from the Windows CtrlHandler");
if (fdwCtrlType == CTRL_CLOSE_EVENT) // Console window closed via 'x' button, Windows will try to close immediately, therefore...
while (!g_ServerTerminated)
{
while (!g_ServerTerminated)
{
std::this_thread::sleep_for(std::chrono::milliseconds(50)); // Delay as much as possible to try to get the server to shut down cleanly
}
std::this_thread::sleep_for(std::chrono::milliseconds(50)); // Delay as much as possible to try to get the server to shut down cleanly
}
return TRUE;