From 67eca664b5429444e2a99d1673ef47f8f70ba4c5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 Jun 2010 11:28:20 +0000 Subject: [PATCH] Stop the timer in console IPC client sample once we don't need it any more. Under MSW the timer appeared to be flooding the message queue with timer events faster than we could process them (which seems incredible for the timer interval of 1 second but still seems to happen), so the idle events were never generated and the sample didn't work at all. Now stop the timer once we get a last notification from it to let the program become idle and run the test function scheduled from the timer handler. See #11528. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64566 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/ipc/baseclient.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/samples/ipc/baseclient.cpp b/samples/ipc/baseclient.cpp index e19e8e274f..acd1507adc 100644 --- a/samples/ipc/baseclient.cpp +++ b/samples/ipc/baseclient.cpp @@ -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()); -- 2.47.2