X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90e95e61175953284a40c73f1d62ccc18ef4c748..fb8d7eb7a880f1f2e32d8830f9c5e12b2536e05f:/src/os2/thread.cpp diff --git a/src/os2/thread.cpp b/src/os2/thread.cpp index 830595af2a..b17b17cb83 100644 --- a/src/os2/thread.cpp +++ b/src/os2/thread.cpp @@ -626,6 +626,14 @@ wxThreadError wxThread::Run() { wxCriticalSectionLocker lock((wxCriticalSection &)m_critsect); + // Create the thread if it wasn't created yet with an explicit + // Create() call: + if ( !m_internal->GetHandle() ) + { + if ( !m_internal->Create(this, 0) ) + return wxTHREAD_NO_RESOURCE; + } + if ( m_internal->GetState() != STATE_NEW ) { // actually, it may be almost any state at all, not only STATE_RUNNING