From 486fa39656e55e4655ab819710c66506d64000cf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 28 Oct 2010 10:27:26 +0000 Subject: [PATCH] Don't crash when waiting for thread termination in wxMSW. The changes of r65882 adding wxThread::On{Delete,Kill}() introduced a bug which made normal wxThread::Wait() crash. Fix it by calling OnDelete() only if we're really deleting a thread. Closed #12627, see #9046. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/thread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 1a668976f3..30f9bca117 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -761,7 +761,8 @@ wxThreadInternal::WaitForTerminate(wxCriticalSection& cs, Cancel(); } - threadToDelete->OnDelete(); + if ( threadToDelete ) + threadToDelete->OnDelete(); // now wait for thread to finish if ( wxThread::IsMain() ) -- 2.45.2