Remove redundant checks for NULL before calling delete

This commit is contained in:
Paul Cornett
2020-02-02 23:51:39 -08:00
parent 05183b7099
commit 0ca45d1a59
23 changed files with 39 additions and 75 deletions

View File

@@ -182,11 +182,9 @@ wxSizerItem* wxGridBagSizer::Add( wxWindow *window,
wxGBSizerItem* item = new wxGBSizerItem(window, pos, span, flag, border, userData);
if ( Add(item) )
return item;
else
{
delete item;
return NULL;
}
delete item;
return NULL;
}
wxSizerItem* wxGridBagSizer::Add( wxSizer *sizer,
@@ -196,11 +194,9 @@ wxSizerItem* wxGridBagSizer::Add( wxSizer *sizer,
wxGBSizerItem* item = new wxGBSizerItem(sizer, pos, span, flag, border, userData);
if ( Add(item) )
return item;
else
{
delete item;
return NULL;
}
delete item;
return NULL;
}
wxSizerItem* wxGridBagSizer::Add( int width, int height,
@@ -210,11 +206,9 @@ wxSizerItem* wxGridBagSizer::Add( int width, int height,
wxGBSizerItem* item = new wxGBSizerItem(width, height, pos, span, flag, border, userData);
if ( Add(item) )
return item;
else
{
delete item;
return NULL;
}
delete item;
return NULL;
}
wxSizerItem* wxGridBagSizer::Add( wxGBSizerItem *item )