]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed thread sample SEGV on wxGTK
authorGuilhem Lavaux <lavaux@easynet.fr>
Thu, 26 Aug 1999 17:35:00 +0000 (17:35 +0000)
committerGuilhem Lavaux <lavaux@easynet.fr>
Thu, 26 Aug 1999 17:35:00 +0000 (17:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/thread/test.cpp
utils/wxMMedia2/lib/sndbase.h

index 706ac23584b93f8c2efd8f5d67672c89ecdd86b9..f5148bde6b3ca8601d38a5ec4c364d47d7e40fbc 100644 (file)
@@ -402,12 +402,16 @@ void MyFrame::OnIdle(wxIdleEvent &event)
 void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
 {
     size_t count = m_threads.Count();
+    m_critsect.Enter();
     for ( size_t i = 0; i < count; i++ )
     {
+        wxThread *thread = m_threads[0];
+        m_threads.Remove(thread);
        // We must always use 0 because Delete() calls OnThreadExit() and 
-        // OnThreadExit() removed 0 from the array.
-        m_threads[0]->Delete();
+        // OnThreadExit() removes 0 from the array.
+        thread->Delete();
     }
+    m_critsect.Leave();
 
     Close(TRUE);
 }
@@ -430,7 +434,4 @@ void MyFrame::OnClear(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnThreadExit(wxThread *thread)
 {
-    wxCriticalSectionLocker enter(m_critsect);
-
-    m_threads.Remove(thread);
 }
index c49aefa2f8abc7625f69552f1ff7ce5e796f5368..f7ecfc6fa5009643277935e78057ad7ef3ea8bd0 100644 (file)
@@ -23,7 +23,8 @@ enum {
 typedef enum {
   wxSOUND_NOFORMAT,
   wxSOUND_PCM,
-  wxSOUND_ULAW
+  wxSOUND_ULAW,
+  wxSOUND_G72X
 } wxSoundFormatType;
 
 typedef enum {