X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/78322206b87bfa0e129f924d31b62c27ccbfc78b..a38b83c353cce75329b2c53c0eaa4ad0f500ccf1:/src/msw/thread.cpp diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 176d1e4cc1..a592fbf29e 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -44,7 +44,7 @@ enum thread_state { ///////////////////////////////////////////////////////////////////////////// static HANDLE p_mainid; -wxMutex wxMainMutex; // controls access to all GUI functions +wxMutex *wxMainMutex; // controls access to all GUI functions ///////////////////////////////////////////////////////////////////////////// // Windows implementation @@ -260,10 +260,10 @@ void *wxThread::Join() return NULL; if (wxThread::IsMain()) - wxMainMutex.Unlock(); + wxMainMutex->Unlock(); WaitForSingleObject(p_internal->thread_id, INFINITE); if (wxThread::IsMain()) - wxMainMutex.Lock(); + wxMainMutex->Lock(); GetExitCodeThread(p_internal->thread_id, &exit_code); CloseHandle(p_internal->thread_id); @@ -310,14 +310,16 @@ class wxThreadModule : public wxModule { DECLARE_DYNAMIC_CLASS(wxThreadModule) public: virtual bool OnInit() { + wxMainMutex = new wxMutex(); p_mainid = GetCurrentThread(); - wxMainMutex.Lock(); + wxMainMutex->Lock(); return TRUE; } // Global cleanup virtual void OnExit() { - wxMainMutex.Unlock(); + wxMainMutex->Unlock(); + delete wxMainMutex; } };