Fixed thread sample SEGV on wxGTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
3372145d9d
commit
9baf15cea6
@ -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);
|
||||
}
|
||||
|
@ -23,7 +23,8 @@ enum {
|
||||
typedef enum {
|
||||
wxSOUND_NOFORMAT,
|
||||
wxSOUND_PCM,
|
||||
wxSOUND_ULAW
|
||||
wxSOUND_ULAW,
|
||||
wxSOUND_G72X
|
||||
} wxSoundFormatType;
|
||||
|
||||
typedef enum {
|
||||
|
Loading…
Reference in New Issue
Block a user