]> git.saurik.com Git - wxWidgets.git/commitdiff
trying to fix the bug which results in blocking forever inside Delete()
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 10 Jul 2003 16:34:45 +0000 (16:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 10 Jul 2003 16:34:45 +0000 (16:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/thread.cpp

index 86bd337e1b8b467a59fd9a4059ead471a06921e9..26a0cbd3fa41ce80e6a56cb537f7d7c94ca190a4 100644 (file)
@@ -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;