diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 86bd337e1b..26a0cbd3fa 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -1046,6 +1046,12 @@ wxThreadError wxThread::Delete(ExitCode *pRc) case WAIT_OBJECT_0 + 1: // new message arrived, process it { + // it looks that sometimes WAIT_OBJECT_0 + 1 is + // returned but there are no messages in the thread + // queue -- prevent DoMessageFromThreadWait() from + // blocking inside ::GetMessage() forever in this case + ::PostMessage(NULL, WM_NULL, 0, 0); + wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;