summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 463c54c28..b6ee8c0a7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -158,9 +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) { cSleep::MilliSleep(100); } // 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;