X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/43b2d5e7c3b3e3d6b245e279dde73d96e0075911..4ff56dd15287c27a545a3da710cdb890288ddcce:/samples/ipc/baseclient.cpp diff --git a/samples/ipc/baseclient.cpp b/samples/ipc/baseclient.cpp index e19e8e274f..4543148f41 100644 --- a/samples/ipc/baseclient.cpp +++ b/samples/ipc/baseclient.cpp @@ -7,7 +7,7 @@ // Created: 2007-11-08 // RCS-ID: $Id$ // Copyright: (c) 2007 Anders Larsen -// License: wxWindows licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -184,8 +184,7 @@ void MyClient::Disconnect() if (m_connection) { m_connection->Disconnect(); - delete m_connection; - m_connection = NULL; + wxDELETE(m_connection); wxLogMessage("Client disconnected from server"); } wxGetApp().ExitMainLoop(); @@ -229,18 +228,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());