From dc1fc1bf65d0eb1227e95f0d6ba167655dded7db Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 7 Feb 2004 13:47:56 +0000 Subject: [PATCH] fix for hanging in wxThread::Delete() (patch 882198) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@25551 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 4 ++-- src/msw/thread.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 4740eab8f9..81d4fb71ab 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -206,9 +206,9 @@ wxMSW: - strip ampersands from strings returned by wxMenuBar::GetLabelTop() - fixed bug in wxIniConfig::DeleteEntry() (Parinya Thipchart) +- fixed hang (sometimes) in wxThread::Delete() (Carl-Friedrich Braun) - wxLongLong formatting with MinGW corrected -- wxFileDialog now returns correct filter index for multiple-file - dialogs +- wxFileDialog now returns correct filter index for multiple-file dialogs wxGTK: diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 8e09e49590..3f0a117ab8 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -887,8 +887,10 @@ wxThreadError wxThread::Delete(ExitCode *pRc) break; case WAIT_OBJECT_0 + 1: - // new message arrived, process it - if ( !wxTheApp->DoMessage() ) + // new message arrived (or maybe not... sometimes the queue + // is empty, hence call Pending() to be sure and not hang + // forever in DoMessage(), process it + if ( wxTheApp->Pending() && !wxTheApp->DoMessage() ) { // WM_QUIT received: kill the thread Kill();