summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-10 02:33:02 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-10 02:33:02 +0200
commit61470cb03d26a9c6059c33b0f0e16125f5f6eae4 (patch)
tree4efd20ddd9fa540127ab8ae4bc0fa735b3307e0a
parent415af32db3321d4b3a8026da46dda451cf44c735 (diff)
downloadmanaplus-61470cb03d26a9c6059c33b0f0e16125f5f6eae4.tar.gz
manaplus-61470cb03d26a9c6059c33b0f0e16125f5f6eae4.tar.bz2
manaplus-61470cb03d26a9c6059c33b0f0e16125f5f6eae4.tar.xz
manaplus-61470cb03d26a9c6059c33b0f0e16125f5f6eae4.zip
Fix memory leak on exit in windowmenu.
-rw-r--r--src/gui/windowmenu.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index 6926e18ae..cfb482841 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -109,6 +109,17 @@ WindowMenu::~WindowMenu()
delete mTextPopup;
mTextPopup = 0;
mButtonNames.clear();
+ std::list <gcn::Button*>::iterator it, it_end;
+ for (it = mButtons.begin(), it_end = mButtons.end(); it != it_end; ++it)
+ {
+ Button *btn = dynamic_cast<Button*>(*it);
+ if (!btn)
+ continue;
+ if (!btn->isVisible())
+ {
+ delete btn;
+ }
+ }
}
void WindowMenu::action(const gcn::ActionEvent &event)