mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 22:58:09 +00:00
WAGE: Stop leaking menu on exit
This commit is contained in:
parent
061a00bf09
commit
db503e967d
@ -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);
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ struct MenuItem;
|
||||
class Menu {
|
||||
public:
|
||||
Menu(Gui *gui);
|
||||
~Menu();
|
||||
|
||||
void render();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user