X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad0500fb78615f351bea58e6aa7e4f46bd091546..163dc80eff2faed2c3c1fb3ee6b46eb5ae9d70f9:/src/os2/thread.cpp?ds=sidebyside diff --git a/src/os2/thread.cpp b/src/os2/thread.cpp index 5c73b1a6ce..c837f5c1a7 100644 --- a/src/os2/thread.cpp +++ b/src/os2/thread.cpp @@ -26,6 +26,7 @@ #include #include "wx/app.h" +#include "wx/apptrait.h" #include "wx/module.h" #include "wx/intl.h" #include "wx/utils.h" @@ -409,10 +410,13 @@ void wxThreadInternal::OS2ThreadStart( } else // do run thread { - HAB vHab; - vHab = ::WinInitialize(0); + wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; + unsigned long ulHab; + if (traits) + traits->InitializeGui(ulHab); dwRet = (DWORD)pThread->Entry(); - ::WinTerminate(vHab); + if (traits) + traits->TerminateGui(ulHab); // enter m_critsect before changing the thread state pThread->m_critsect.Enter();