X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2eb10e2a17a02acaaa32a41304243999f3a862a1..a1900c9e1d07ac71f373f94656bf26a45f032c39:/src/msw/thread.cpp diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index c166f73cf5..7c66077a99 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -10,7 +10,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "thread.h" #endif @@ -818,7 +818,15 @@ wxThreadInternal::WaitForTerminate(bool shouldCancel, break; case WAIT_OBJECT_0 + 1: - // new message arrived, process it + // 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 + // window somehow (possible not even using wxWindows) + // the system might dead lock then + if ( wxThread::IsMain() ) { // it looks that sometimes WAIT_OBJECT_0 + 1 is // returned but there are no messages in the thread