void MyFrame::OnClose(wxCloseEvent& event)
{
- if (m_client)
- {
- delete m_client;
- m_client = NULL;
- }
+ wxDELETE(m_client);
+
event.Skip();
}
if (!retval)
{
- delete m_client;
- m_client = NULL;
+ wxDELETE(m_client);
}
EnableControls();
}
void MyFrame::Disconnect()
{
- delete m_client;
- m_client = NULL;
+ wxDELETE(m_client);
EnableControls();
}
if (m_connection)
{
m_connection->Disconnect();
- delete m_connection;
- m_connection = NULL;
+ wxDELETE(m_connection);
wxGetApp().GetFrame()->EnableControls();
wxLogMessage(wxT("Client disconnected from server"));
}