summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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)