diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2011-11-07 12:49:03 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-07 12:49:03 +0000 |
commit | 2411ea09a8d20609e48b0750ab2102c00e0c3b8a (patch) | |
tree | 18c8dd0e5784ea488e2744067225689b85f8ed1f | |
parent | 2ea9da71470a9e2a442ec6a660de47691a3f8723 (diff) |
redundant if not-null checks on delete
-rw-r--r-- | vcl/aqua/source/window/salframe.cxx | 3 | ||||
-rw-r--r-- | vcl/ios/source/window/salframe.cxx | 3 | ||||
-rwxr-xr-x | vcl/source/app/dbggui.cxx | 3 | ||||
-rw-r--r-- | vcl/source/app/settings.cxx | 6 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 3 | ||||
-rw-r--r-- | vcl/source/control/menubtn.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/regband.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/accmgr.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/brdwin.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/msgbox.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/splitwin.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/tabdlg.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 12 | ||||
-rw-r--r-- | vcl/win/source/gdi/salgdi.cxx | 9 | ||||
-rw-r--r-- | vcl/win/source/window/salobj.cxx | 3 |
16 files changed, 25 insertions, 50 deletions
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx index 5ac2842cb469..7733649f2768 100644 --- a/vcl/aqua/source/window/salframe.cxx +++ b/vcl/aqua/source/window/salframe.cxx @@ -128,8 +128,7 @@ AquaSalFrame::~AquaSalFrame() if( this == s_pCaptureFrame ) s_pCaptureFrame = NULL; - if ( mpGraphics ) - delete mpGraphics; + delete mpGraphics; if( mpDockMenuEntry ) // life cycle comment: the menu has ownership of the item, so no release diff --git a/vcl/ios/source/window/salframe.cxx b/vcl/ios/source/window/salframe.cxx index 8e2ea9d7c910..3aab37a32190 100644 --- a/vcl/ios/source/window/salframe.cxx +++ b/vcl/ios/source/window/salframe.cxx @@ -106,8 +106,7 @@ IosSalFrame::~IosSalFrame() if( this == s_pCaptureFrame ) s_pCaptureFrame = NULL; - if ( mpGraphics ) - delete mpGraphics; + delete mpGraphics; if ( mpView ) { [mpView release]; diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index 6e76706d87ba..468e7c87ae65 100755 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -1998,8 +1998,7 @@ void DbgGUIDeInit() DbgSetAbort( NULL ); DbgWindow* pDbgWindow = ImplGetSVData()->maWinData.mpDbgWin; - if ( pDbgWindow ) - delete pDbgWindow; + delete pDbgWindow; } // ----------------------------------------------------------------------- diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 1795d5a34496..533fe6b3ac64 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -1546,10 +1546,8 @@ ImplAllSettingsData::ImplAllSettingsData( const ImplAllSettingsData& rData ) : ImplAllSettingsData::~ImplAllSettingsData() { - if ( mpLocaleDataWrapper ) - delete mpLocaleDataWrapper; - if ( mpUILocaleDataWrapper ) - delete mpUILocaleDataWrapper; + delete mpLocaleDataWrapper; + delete mpUILocaleDataWrapper; if ( mpI18nHelper ) delete mpI18nHelper; if ( mpUII18nHelper ) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index cf8386903173..a0a81e93a573 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -253,8 +253,7 @@ Edit::~Edit() delete mpIMEInfos; - if ( mpUpdateDataTimer ) - delete mpUpdateDataTimer; + delete mpUpdateDataTimer; if ( mxDnDListener.is() ) { diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index 13513f62b719..2e1ad53beee3 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -133,10 +133,8 @@ void MenuButton::ImplLoadRes( const ResId& rResId ) MenuButton::~MenuButton() { - if ( mpMenuTimer ) - delete mpMenuTimer; - if ( mpOwnMenu ) - delete mpOwnMenu; + delete mpMenuTimer; + delete mpOwnMenu; } // ----------------------------------------------------------------------- diff --git a/vcl/source/gdi/regband.cxx b/vcl/source/gdi/regband.cxx index 1cec295bda93..b091783161ea 100644 --- a/vcl/source/gdi/regband.cxx +++ b/vcl/source/gdi/regband.cxx @@ -201,8 +201,7 @@ void ImplRegionBand::ProcessPoints() } // remove last element if necessary - if ( pRegionBandPoint ) - delete pRegionBandPoint; + delete pRegionBandPoint; // list is now empty mpFirstBandPoint = NULL; diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx index 43c78d55adc1..a14530abe47a 100644 --- a/vcl/source/window/accmgr.cxx +++ b/vcl/source/window/accmgr.cxx @@ -43,10 +43,8 @@ DBG_NAMEEX( Accelerator ) ImplAccelManager::~ImplAccelManager() { - if ( mpAccelList ) - delete mpAccelList; - if ( mpSequenceList ) - delete mpSequenceList; + delete mpAccelList; + delete mpSequenceList; } // ----------------------------------------------------------------------- diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index d048b3ab6fba..bf25f347b079 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -1438,10 +1438,8 @@ ImplStdBorderWindowView::ImplStdBorderWindowView( ImplBorderWindow* pBorderWindo ImplStdBorderWindowView::~ImplStdBorderWindowView() { - if ( mpATitleVirDev ) - delete mpATitleVirDev; - if ( mpDTitleVirDev ) - delete mpDTitleVirDev; + delete mpATitleVirDev; + delete mpDTitleVirDev; } // ----------------------------------------------------------------------- diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index bc328326e5c2..4b4861aa65cd 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -258,8 +258,7 @@ void MessBox::ImplPosControls() WinBits nWinStyle = WB_LEFT | WB_WORDBREAK | WB_NOLABEL | WB_INFO; sal_uInt16 nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT; - if ( mpFixedText ) - delete mpFixedText; + delete mpFixedText; if ( mpFixedImage ) { delete mpFixedImage; diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index ed717f67be7c..8850e7d60951 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -2621,8 +2621,7 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) if ( rTEvt.IsTrackingEnded() ) { - if ( mpLastSizes ) - delete mpLastSizes; + delete mpLastSizes; mpLastSizes = NULL; mpSplitSet = NULL; mnMouseOff = 0; diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index 32e8a0dcec92..beb02a1dbc16 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -239,8 +239,7 @@ TabDialog::TabDialog( Window* pParent, const ResId& rResId ) : TabDialog::~TabDialog() { - if ( mpFixedLine ) - delete mpFixedLine; + delete mpFixedLine; } // ----------------------------------------------------------------------- diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 87347e829a56..13a56487340f 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -1796,8 +1796,7 @@ ToolBox::~ToolBox() delete mpData; // FloatSizeAry gegebenenfalls loeschen - if ( mpFloatSizeAry ) - delete mpFloatSizeAry; + delete mpFloatSizeAry; // Wenn keine ToolBox-Referenzen mehr auf die Listen bestehen, dann // Listen mit wegloeschen diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index f64a3a6daecf..1dc681cac964 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1899,8 +1899,7 @@ sal_Bool Window::ImplSetClipFlagChilds( sal_Bool bSysObjOnlySmaller ) bUpdate = sal_False; } - if ( pOldRegion ) - delete pOldRegion; + delete pOldRegion; } else { @@ -2459,8 +2458,7 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags ) if( !aSelectionRect.IsEmpty() ) DrawSelectionBackground( aSelectionRect, 3, sal_False, sal_True, sal_False ); - if ( pChildRegion ) - delete pChildRegion; + delete pChildRegion; } // ----------------------------------------------------------------------- @@ -3469,10 +3467,8 @@ void Window::ImplPosSizeWindow( long nX, long nY, mpWindowImpl->mpSysObj->SetPosSize( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ); } - if ( pOverlapRegion ) - delete pOverlapRegion; - if ( pOldRegion ) - delete pOldRegion; + delete pOverlapRegion; + delete pOldRegion; } // ----------------------------------------------------------------------- diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx index 3c0e828a87ca..ee347583393b 100644 --- a/vcl/win/source/gdi/salgdi.cxx +++ b/vcl/win/source/gdi/salgdi.cxx @@ -785,14 +785,11 @@ WinSalGraphics::~WinSalGraphics() if ( mpStdClipRgnData ) delete [] mpStdClipRgnData; - if ( mpLogFont ) - delete mpLogFont; + delete mpLogFont; - if ( mpFontCharSets ) - delete mpFontCharSets; + delete mpFontCharSets; - if ( mpFontKernPairs ) - delete mpFontKernPairs; + delete mpFontKernPairs; } // ----------------------------------------------------------------------- diff --git a/vcl/win/source/window/salobj.cxx b/vcl/win/source/window/salobj.cxx index 0ee631d27d84..01ffd8b20652 100644 --- a/vcl/win/source/window/salobj.cxx +++ b/vcl/win/source/window/salobj.cxx @@ -654,8 +654,7 @@ WinSalObject::~WinSalObject() } // Cache-Daten zerstoeren - if ( mpStdClipRgnData ) - delete mpStdClipRgnData; + delete mpStdClipRgnData; HWND hWndParent = ::GetParent( mhWnd ); |