X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c5fb56c07a3718798459a69c74b3124ab58c65b5..5e84fc5a820a15a1ce2d32d2ae71f0bf92abda3d:/src/os2/thread.cpp diff --git a/src/os2/thread.cpp b/src/os2/thread.cpp index a2b1004172..80eef6b2e2 100644 --- a/src/os2/thread.cpp +++ b/src/os2/thread.cpp @@ -100,8 +100,7 @@ wxMutex::~wxMutex() if (m_locked > 0) wxLogDebug(wxT("Warning: freeing a locked mutex (%d locks)."), m_locked); ::DosCloseMutexSem(p_internal->m_vMutex); - delete p_internal; - p_internal = NULL; + p_internal->m_vMutex = NULL; } wxMutexError wxMutex::Lock() @@ -244,6 +243,34 @@ void wxCondition::Broadcast() // wxCriticalSection implementation // ---------------------------------------------------------------------------- +class wxCriticalSectionInternal +{ +public: + // init the critical section object + wxCriticalSectionInternal() + { } + + // free the associated ressources + ~wxCriticalSectionInternal() + { } + +private: +}; + +// ---------------------------------------------------------------------------- +// wxCriticalSection implementation +// ---------------------------------------------------------------------------- + +wxCriticalSection::wxCriticalSection() +{ + m_critsect = new wxCriticalSectionInternal; +} + +wxCriticalSection::~wxCriticalSection() +{ + delete m_critsect; +} + void wxCriticalSection::Enter() { ::DosEnterCritSec();