// Created: 2007-11-08
// RCS-ID: $Id$
// Copyright: (c) 2007 Anders Larsen
-// License: wxWindows licence
+// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
if (m_connection)
{
m_connection->Disconnect();
- delete m_connection;
- m_connection = NULL;
+ wxDELETE(m_connection);
wxLogMessage("Client disconnected from server");
}
wxGetApp().ExitMainLoop();
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());
Log("Execute", wxEmptyString, wxEmptyString, data, size, format);
bool retval = wxConnection::DoExecute(data, size, format);
if (!retval)
+ {
wxLogMessage("Execute failed!");
+ }
return retval;
}