X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e536b75069b5caa8333c5609bfe05b68ba2b5653..8a31648287be0ef976f133de2786b137f1e98340:/samples/ipc/server.cpp diff --git a/samples/ipc/server.cpp b/samples/ipc/server.cpp index 4bd26352a2..26b09f6791 100644 --- a/samples/ipc/server.cpp +++ b/samples/ipc/server.cpp @@ -160,11 +160,7 @@ void MyFrame::UpdateUI() void MyFrame::OnClose(wxCloseEvent& event) { - if (m_server) - { - delete m_server; - m_server = NULL; - } + wxDELETE(m_server); event.Skip(); } @@ -185,8 +181,7 @@ void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event)) else { wxLogMessage("Server %s failed to start", servername); - delete m_server; - m_server = NULL; + wxDELETE(m_server); } UpdateUI(); } @@ -262,8 +257,7 @@ void MyServer::Disconnect() { if ( m_connection ) { - delete m_connection; - m_connection = NULL; + wxDELETE(m_connection); wxGetApp().GetFrame()->UpdateUI(); wxLogMessage("Disconnected client"); }