aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-01-11 19:55:37 +0100
committerEugene Sandulenko2016-01-11 19:55:37 +0100
commitdb503e967dbd93458cf59837679c0f4a60d1420e (patch)
tree4d0dead4bbad713c84e6ce84564329bfd2a3ce8b
parent061a00bf09dc80b4e60e2718f0103f59951f1d5c (diff)
downloadscummvm-rg350-db503e967dbd93458cf59837679c0f4a60d1420e.tar.gz
scummvm-rg350-db503e967dbd93458cf59837679c0f4a60d1420e.tar.bz2
scummvm-rg350-db503e967dbd93458cf59837679c0f4a60d1420e.zip
WAGE: Stop leaking menu on exit
-rw-r--r--engines/wage/menu.cpp10
-rw-r--r--engines/wage/menu.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/engines/wage/menu.cpp b/engines/wage/menu.cpp
index 4407ba282d..1fc4028723 100644
--- a/engines/wage/menu.cpp
+++ b/engines/wage/menu.cpp
@@ -62,6 +62,7 @@ struct MenuSubItem {
int style;
char shortcut;
bool enabled;
+ Common::Rect bbox;
MenuSubItem(const char *t, int a, int s = 0, char sh = 0, bool e = true) : text(t), action(a), style(s), shortcut(sh), enabled(e) {}
};
@@ -69,6 +70,7 @@ struct MenuSubItem {
struct MenuItem {
Common::String name;
Common::Array<MenuSubItem *> subitems;
+ Common::Rect bbox;
MenuItem(const char *n) : name(n) {}
};
@@ -145,6 +147,14 @@ Menu::Menu(Gui *gui) : _gui(gui) {
}
}
+Menu::~Menu() {
+ for (int i = 0; i < _items.size(); i++) {
+ for (int j = 0; j < _items[i]->subitems.size(); j++)
+ delete _items[i]->subitems[j];
+ delete _items[i];
+ }
+}
+
const Graphics::Font *Menu::getMenuFont() {
return _gui->getFont("Chicago-12", Graphics::FontManager::kBigGUIFont);
}
diff --git a/engines/wage/menu.h b/engines/wage/menu.h
index aec92cf5e1..6034ee494d 100644
--- a/engines/wage/menu.h
+++ b/engines/wage/menu.h
@@ -55,6 +55,7 @@ struct MenuItem;
class Menu {
public:
Menu(Gui *gui);
+ ~Menu();
void render();