summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabbedarea.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-05-25 02:51:51 +0300
committerAndrei Karas <akaras@inbox.ru>2011-05-25 02:51:51 +0300
commit8d80b897b5863372649de9b5f3c8d7234ae47f58 (patch)
treea109bb1adeee89489113a4637ecd197dae403018 /src/gui/widgets/tabbedarea.cpp
parent1f4032b8de527da72ef4b89371c077eea644fdf2 (diff)
downloadManaVerse-8d80b897b5863372649de9b5f3c8d7234ae47f58.tar.gz
ManaVerse-8d80b897b5863372649de9b5f3c8d7234ae47f58.tar.bz2
ManaVerse-8d80b897b5863372649de9b5f3c8d7234ae47f58.tar.xz
ManaVerse-8d80b897b5863372649de9b5f3c8d7234ae47f58.zip
Fix some memory leaks in being, debugwindow, shortcutwindow, skilldialog, map classes.
Diffstat (limited to 'src/gui/widgets/tabbedarea.cpp')
-rw-r--r--src/gui/widgets/tabbedarea.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index 6c2ef5b25..b20237c1b 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -442,6 +442,24 @@ gcn::Widget *TabbedArea::getWidgetByIndex(int index) const
return mTabs[index].second;
}
+void TabbedArea::removeAll()
+{
+ if (getSelectedTabIndex() != -1)
+ {
+ setSelectedTab(static_cast<unsigned int>(0));
+
+ }
+ while (getNumberOfTabs() > 0)
+ {
+ const int idx = getNumberOfTabs() - 1;
+ gcn::Tab *tab = mTabs[idx].first;
+ Widget *widget = mTabs[idx].second;
+ removeTab(tab);
+ delete tab;
+ delete widget;
+ }
+}
+
/*
void TabbedArea::moveLeft(gcn::Tab *tab)
{