]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/thread.cpp
docs and example for wxDC::DrawPolyPolygon() (patch 882189)
[wxWidgets.git] / src / os2 / thread.cpp
index 5c73b1a6ce9a898ebf685a9e679c77973c6f436b..c837f5c1a72630ddb39144901b8de0ff2025df3a 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdio.h>
 
 #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();