]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/thread.cpp
Replaced an old ifndef FWD_ONLY_CURSORS with the new wxODBC_FWD_ONLY_CURSORS setup...
[wxWidgets.git] / src / os2 / thread.cpp
index a2b10041725236f46c96946897fa913d1f389f70..80eef6b2e2dc60e88844396744aec0a1a6347f8e 100644 (file)
@@ -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();