diff options
Diffstat (limited to 'sword1/menu.cpp')
-rw-r--r-- | sword1/menu.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sword1/menu.cpp b/sword1/menu.cpp index 61c8236ffa..89eac4ed2e 100644 --- a/sword1/menu.cpp +++ b/sword1/menu.cpp @@ -103,6 +103,18 @@ Menu::Menu(Screen *pScreen, Mouse *pMouse) { _inMenu = 0; } +Menu::~Menu(void) { + // the menu may be open, so delete the icons + for (int i = 0; i < TOTAL_pockets; i++) { + delete _objects[i]; + _objects[i] = NULL; + } + for (int i = 0; i < TOTAL_subjects; i++) { + delete _subjects[i]; + _subjects[i] = NULL; + } +} + void Menu::refreshMenus() { if (_objectBarStatus == MENU_OPEN) { buildMenu(); |