]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/ipc/baseclient.cpp
Stop the timer in console IPC client sample once we don't need it any more.
[wxWidgets.git] / samples / ipc / baseclient.cpp
index e19e8e274fb83773b9539c7b995212e3621801fd..acd1507adc2ea105bed26a1e7052d2391884cb4e 100644 (file)
@@ -229,18 +229,23 @@ void MyClient::Notify()
 
         case 15:
             testfunc = &MyClient::TestDisconnect;
+            // We don't need the timer any more, we're going to exit soon.
+            Stop();
             break;
+
+        default:
+            // No need to wake up idle handling.
+            return;
     }
 
-    if ( testfunc )
-        m_tests.push_back(testfunc);
+    m_tests.push_back(testfunc);
 
     wxWakeUpIdle();
 }
 
 void MyClient::StartNextTestIfNecessary()
 {
-    if ( !m_tests.empty() )
+    while ( !m_tests.empty() )
     {
         MyClientTestFunc testfunc = m_tests.front();
         m_tests.erase(m_tests.begin());