diff --git a/src/itemdrag.cpp b/src/itemdrag.cpp index 5b859203f..048415c3d 100644 --- a/src/itemdrag.cpp +++ b/src/itemdrag.cpp @@ -37,10 +37,8 @@ void ItemDrag::__dragIsDone() { } void ItemDrag::cleanup() { - if (Singleton) { - delete Singleton; - Singleton = NULL; - } + delete Singleton; + Singleton = NULL; } QHash & ItemDrag::cache() { diff --git a/src/partsbinpalette/partsbinpalettewidget.cpp b/src/partsbinpalette/partsbinpalettewidget.cpp index 9f37ec77c..06a77ca35 100644 --- a/src/partsbinpalette/partsbinpalettewidget.cpp +++ b/src/partsbinpalette/partsbinpalettewidget.cpp @@ -144,8 +144,8 @@ PartsBinPaletteWidget::~PartsBinPaletteWidget() { m_model = NULL; } - if (m_icon) delete m_icon; - if (m_monoIcon) delete m_monoIcon; + delete m_icon; + delete m_monoIcon; } void PartsBinPaletteWidget::cleanup() { diff --git a/src/partsbinpalette/svgiconwidget.cpp b/src/partsbinpalette/svgiconwidget.cpp index ec7938947..39ea2cd07 100644 --- a/src/partsbinpalette/svgiconwidget.cpp +++ b/src/partsbinpalette/svgiconwidget.cpp @@ -119,14 +119,11 @@ void SvgIconWidget::initNames() { } void SvgIconWidget::cleanup() { - if (PluralImage) { - delete PluralImage; - PluralImage = nullptr; - } - if (SingularImage) { - delete SingularImage; - SingularImage = nullptr; - } + delete PluralImage; + delete SingularImage; + + PluralImage = nullptr; + SingularImage = nullptr; } ItemBase *SvgIconWidget::itemBase() const noexcept {