X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3cb332c1553bb977cb8db16c19c733684ef72805..65fb4b3a4f18e1d8b58ac92d50d4cc7f81f03783:/samples/ipc/client.cpp diff --git a/samples/ipc/client.cpp b/samples/ipc/client.cpp index 99f160aaef..a91f524d7d 100644 --- a/samples/ipc/client.cpp +++ b/samples/ipc/client.cpp @@ -35,7 +35,7 @@ #include "wx/datetime.h" #include "client.h" -#if !defined(__WXMSW__) && !defined(__WXPM__) +#ifndef wxHAS_IMAGES_IN_RESOURCES #include "../sample.xpm" #endif @@ -232,11 +232,8 @@ void MyFrame::EnableControls() void MyFrame::OnClose(wxCloseEvent& event) { - if (m_client) - { - delete m_client; - m_client = NULL; - } + wxDELETE(m_client); + event.Skip(); } @@ -261,8 +258,7 @@ void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event)) if (!retval) { - delete m_client; - m_client = NULL; + wxDELETE(m_client); } EnableControls(); } @@ -316,8 +312,7 @@ void MyFrame::OnDisconnect(wxCommandEvent& WXUNUSED(event)) void MyFrame::Disconnect() { - delete m_client; - m_client = NULL; + wxDELETE(m_client); EnableControls(); } @@ -399,8 +394,7 @@ void MyClient::Disconnect() if (m_connection) { m_connection->Disconnect(); - delete m_connection; - m_connection = NULL; + wxDELETE(m_connection); wxGetApp().GetFrame()->EnableControls(); wxLogMessage(wxT("Client disconnected from server")); }