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();