X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..34326da778583ca8eab95f2e41738da2852a5a16:/samples/ipc/client.cpp?ds=sidebyside diff --git a/samples/ipc/client.cpp b/samples/ipc/client.cpp index 36c9d4552d..a91f524d7d 100644 --- a/samples/ipc/client.cpp +++ b/samples/ipc/client.cpp @@ -32,13 +32,13 @@ // we're using TCP/IP or real DDE. #include "ipcsetup.h" -#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) -#include "mondrian.xpm" -#endif - #include "wx/datetime.h" #include "client.h" +#ifndef wxHAS_IMAGES_IN_RESOURCES + #include "../sample.xpm" +#endif + // ---------------------------------------------------------------------------- // wxWin macros // ---------------------------------------------------------------------------- @@ -97,7 +97,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title) : wxFrame(frame, wxID_ANY, title, wxDefaultPosition, wxSize(400, 300)) { // Give it an icon - SetIcon(wxICON(mondrian)); + SetIcon(wxICON(sample)); // Make a menubar wxMenu *file_menu = new wxMenu; @@ -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")); }