diff --git a/src/lib/platform/MSWindowsWatchdog.cpp b/src/lib/platform/MSWindowsWatchdog.cpp index c57fb278..837db1de 100644 --- a/src/lib/platform/MSWindowsWatchdog.cpp +++ b/src/lib/platform/MSWindowsWatchdog.cpp @@ -552,11 +552,12 @@ MSWindowsWatchdog::getActiveDesktop(LPSECURITY_ATTRIBUTES security) ARCH->lockMutex(m_mutex); int waitTime = 0; while (!m_ready) { + if (waitTime >= MAXIMUM_WAIT_TIME) { break; } ARCH->waitCondVar(m_condVar, m_mutex, 1.0); - i++; + waitTime++; } m_ready = false; ARCH->unlockMutex(m_mutex);