From: Guilhem Lavaux Date: Thu, 26 Aug 1999 17:35:00 +0000 (+0000) Subject: Fixed thread sample SEGV on wxGTK X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9baf15cea675486fb476f4862a30a2d366534bca Fixed thread sample SEGV on wxGTK git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/thread/test.cpp b/samples/thread/test.cpp index 706ac23584..f5148bde6b 100644 --- a/samples/thread/test.cpp +++ b/samples/thread/test.cpp @@ -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); } diff --git a/utils/wxMMedia2/lib/sndbase.h b/utils/wxMMedia2/lib/sndbase.h index c49aefa2f8..f7ecfc6fa5 100644 --- a/utils/wxMMedia2/lib/sndbase.h +++ b/utils/wxMMedia2/lib/sndbase.h @@ -23,7 +23,8 @@ enum { typedef enum { wxSOUND_NOFORMAT, wxSOUND_PCM, - wxSOUND_ULAW + wxSOUND_ULAW, + wxSOUND_G72X } wxSoundFormatType; typedef enum {