]> git.saurik.com Git - wxWidgets.git/commitdiff
no need to test that the pointer is non-NULL before deleting it (closes #10070)
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 13 Oct 2008 10:35:07 +0000 (10:35 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 13 Oct 2008 10:35:07 +0000 (10:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/dataview.cpp
src/osx/carbon/taskbar.cpp
src/osx/carbon/tooltip.cpp
src/osx/core/hidjoystick.cpp
src/osx/core/printmac.cpp
src/osx/window_osx.cpp

index 111109c986a08c2beff42d01c1b79260f559e71b..3255d7dc9807f0bd6482ba5b73adb4ea947275bd 100644 (file)
@@ -547,7 +547,6 @@ wxDataViewCustomRenderer::wxDataViewCustomRenderer(wxString const& varianttype,
 
 wxDataViewCustomRenderer::~wxDataViewCustomRenderer()
 {
-  if (this->m_DCPtr != NULL)
     delete this->m_DCPtr;
 } /* wxDataViewCustomRenderer::~wxDataViewCustomRenderer() */
 
index ffca169573c1bc4c709154a0c2b1e8b3ca116f2e..cd479a6f2d8320776fe22e394a73a303a6798918 100644 (file)
@@ -347,8 +347,7 @@ wxMenu * wxDockTaskBarIcon::DoCreatePopupMenu()
 
     if (theNewMenu)
     {
-        if (m_pMenu)
-            delete m_pMenu;
+        delete m_pMenu;
         m_pMenu = theNewMenu;
         m_pMenu->SetInvokingWindow(m_menuEventWindow);
     }
@@ -442,8 +441,7 @@ bool wxDockTaskBarIcon::PopupMenu(wxMenu *menu)
 {
     wxASSERT(menu != NULL);
 
-    if (m_pMenu)
-        delete m_pMenu;
+    delete m_pMenu;
 
     // start copy of menu
     m_pMenu = wxDeepCopyMenu(menu);
index 4252ce410c6f1085ef918285011c650ca0b03c73..f7b4857e9e0256ab76853f1c2f790261356ccac3 100644 (file)
@@ -190,8 +190,7 @@ void wxMacToolTip::Setup( WindowRef win  , const wxString& text , const wxPoint&
     s_ToolTipWindowRef = m_window ;
     m_backpict = NULL ;
 #if wxUSE_TIMER 
-    if ( m_timer )
-        delete m_timer ;
+    delete m_timer ;
 
     m_timer = new wxMacToolTipTimer( this , s_ToolTipDelay ) ;
 #endif // wxUSE_TIMER
index 2d6242d0b3842a6306e7435bb8abe7edfa8b0ba4..7f687653414f1a52f6a8f31919cfc66c2d73ce15 100644 (file)
@@ -174,8 +174,7 @@ wxJoystick::~wxJoystick()
     if (m_thread)
         m_thread->Delete();  // It's detached so it will delete itself
 
-    if (m_hid)
-        delete m_hid;
+    delete m_hid;
 }
 
 //---------------------------------------------------------------------------
index 522d6b8892de392023fcb9a1bc9ee606b4923cee..825c8326d78eb4226fe5e7486aa8ea5f933d7308 100644 (file)
@@ -411,8 +411,7 @@ bool wxMacPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
     // May have pressed cancel.
     if (!dc || !dc->IsOk())
     {
-        if (dc)
-            delete dc;
+        delete dc;
         return false;
     }
 
index 3ad07ae4d2c168047fb2bd121fdaaf34e4133f40..ebec85144e22944b258701de7a433a3cf11b0437 100644 (file)
@@ -448,8 +448,7 @@ void wxWindowMac::DoReleaseMouse()
 
 void wxWindowMac::SetDropTarget(wxDropTarget *pDropTarget)
 {
-    if ( m_dropTarget != NULL )
-        delete m_dropTarget;
+    delete m_dropTarget;
 
     m_dropTarget = pDropTarget;
     if ( m_dropTarget != NULL )