summaryrefslogtreecommitdiff
path: root/src/gui/windows/statuswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-27 02:38:38 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-27 02:38:38 +0300
commitde43e2592dfce797245e63e865a0f8e8567b4ac7 (patch)
tree4d7fdbf2095767a47a085667e3438f2edd6cabef /src/gui/windows/statuswindow.cpp
parent0419f9b7ea98b9de36b6af97fccd964d3cda4750 (diff)
downloadmanaplus-de43e2592dfce797245e63e865a0f8e8567b4ac7.tar.gz
manaplus-de43e2592dfce797245e63e865a0f8e8567b4ac7.tar.bz2
manaplus-de43e2592dfce797245e63e865a0f8e8567b4ac7.tar.xz
manaplus-de43e2592dfce797245e63e865a0f8e8567b4ac7.zip
Remove all pages after status window deleted.
Diffstat (limited to 'src/gui/windows/statuswindow.cpp')
-rw-r--r--src/gui/windows/statuswindow.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 57ca97206..6106372bf 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -52,6 +52,8 @@
#include "resources/item/item.h"
+#include "utils/delete2.h"
+#include "utils/dtor.h"
#include "utils/gettext.h"
#include "debug.h"
@@ -64,6 +66,7 @@ StatusWindow::StatusWindow() :
ActionListener(),
AttributeListener(),
StatListener(),
+ mPages(),
mTabs(CREATEWIDGETR(TabbedArea, this)),
// TRANSLATORS: status window label
mLvlLabel(new Label(this, strprintf(_("Level: %d"), 0))),
@@ -211,6 +214,12 @@ StatusWindow::StatusWindow() :
addTabs();
}
+StatusWindow::~StatusWindow()
+{
+ delete2(mBasicStatsPage);
+ delete_all(mPages);
+}
+
void StatusWindow::addTabs()
{
// TRANSLATORS: status window tab name
@@ -225,8 +234,10 @@ void StatusWindow::addTabs()
void StatusWindow::addTab(const std::string &name)
{
+ StatsPage *const page = new StatsPage(this, name);
mTabs->addTab(name,
- new StatsPage(this, name));
+ page);
+ mPages.push_back(page);
}
void StatusWindow::addTabBasic(const std::string &name)