]> git.saurik.com Git - wxWidgets.git/commitdiff
tried to fix a race condition in the sample, not sure if I really did it though
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 20 Jun 2002 22:25:01 +0000 (22:25 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 20 Jun 2002 22:25:01 +0000 (22:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/thread/thread.cpp

index 7ca5a653d236e56df2308ad569844c3b3373be24..b176ef8c01b2e339b5198734770b888f0350a1ac 100644 (file)
@@ -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);