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