From 0c35dab0ba366f85b40ef1795125521f1df8c264 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 28 Mar 2014 00:39:12 +0300 Subject: simplify variables cleanup. --- src/gui/widgets/tabbedarea.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/gui/widgets/tabbedarea.cpp') diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 3cb6cb302..cf55fa10b 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -75,6 +75,8 @@ #include "gui/widgets/scrollarea.h" #include "gui/widgets/tabs/tab.h" +#include "utils/delete2.h" + #include "debug.h" TabbedArea::TabbedArea(const Widget2 *const widget) : @@ -127,21 +129,14 @@ TabbedArea::~TabbedArea() remove(mTabContainer); remove(mWidgetContainer); - delete mTabContainer; - mTabContainer = nullptr; - delete mWidgetContainer; - mWidgetContainer = nullptr; + delete2(mTabContainer); + delete2(mWidgetContainer); for (size_t i = 0, sz = mTabsToDelete.size(); i < sz; i++) - { - delete mTabsToDelete[i]; - mTabsToDelete[i] = nullptr; - } + delete2(mTabsToDelete[i]) - delete mArrowButton[0]; - mArrowButton[0] = nullptr; - delete mArrowButton[1]; - mArrowButton[1] = nullptr; + delete2(mArrowButton[0]); + delete2(mArrowButton[1]); } void TabbedArea::enableScrollButtons(const bool enable) -- cgit v1.2.3-70-g09d2