]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/ipc/client.cpp
prevent infinite loop if gtk_menu_popup() fails, fixes #15387
[wxWidgets.git] / samples / ipc / client.cpp
index 99f160aaef443251c1c40f8a23d29be34cec3736..7ed6920717560ee00a80a9be063ff37175ba1ec3 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Julian Smart
 // Modified by:    Jurgen Doornik
 // Created:     25/01/99
-// RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -35,7 +34,7 @@
 #include "wx/datetime.h"
 #include "client.h"
 
-#if !defined(__WXMSW__) && !defined(__WXPM__)
+#ifndef wxHAS_IMAGES_IN_RESOURCES
     #include "../sample.xpm"
 #endif
 
@@ -232,11 +231,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 +257,7 @@ void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event))
 
     if (!retval)
     {
-        delete m_client;
-        m_client = NULL;
+        wxDELETE(m_client);
     }
     EnableControls();
 }
@@ -316,8 +311,7 @@ void MyFrame::OnDisconnect(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::Disconnect()
 {
-    delete m_client;
-    m_client = NULL;
+    wxDELETE(m_client);
     EnableControls();
 }
 
@@ -399,8 +393,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"));
     }