From: Vadim Zeitlin Date: Thu, 20 Jun 2002 22:25:01 +0000 (+0000) Subject: tried to fix a race condition in the sample, not sure if I really did it though X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d1148d2418046b506950cab36e8afb23978dd357 tried to fix a race condition in the sample, not sure if I really did it though git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/thread/thread.cpp b/samples/thread/thread.cpp index 7ca5a653d2..b176ef8c01 100644 --- a/samples/thread/thread.cpp +++ b/samples/thread/thread.cpp @@ -563,10 +563,10 @@ void MyFrame::OnIdle(wxIdleEvent &event) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) ) { - size_t count = wxGetApp().m_threads.Count(); - for ( size_t i = 0; i < count; i++ ) + const wxArrayThread& threads = wxGetApp().m_threads; + while ( !threads.IsEmpty() ) { - wxGetApp().m_threads[0]->Delete(); + threads[0]->Delete(); } Close(TRUE);