From 6af532971018b8ceea0d8e2543ee459d009d61d1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 2 Nov 2015 18:17:03 +0100 Subject: [PATCH] Fix waiting for threads in MSW in presence of events We need to handle WAIT_OBJECT_0+2 value which can be returned by WaitForThread() since 6c40531fb763fcb850bfe275bdcac018b147be7c as it now waits for two objects and not just one, failure to do this resulted in an endless stream of asserts if any Windows messages were pending when we started waiting for the thread. --- src/msw/thread.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index e81ace4bc9..154dbb740b 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -800,9 +800,10 @@ wxThreadInternal::WaitForTerminate(wxCriticalSection& cs, break; case WAIT_OBJECT_0 + 1: - // new message arrived, process it -- but only if we're the - // main thread as we don't support processing messages in - // the other ones + case WAIT_OBJECT_0 + 2: + // Wake up has been signaled or a new message arrived, process + // it -- but only if we're the main thread as we don't support + // processing messages in the other ones // // NB: we still must include QS_ALLINPUT even when waiting // in a secondary thread because if it had created some