diff options
author | Robert Göffringmann | 2004-11-09 04:06:10 +0000 |
---|---|---|
committer | Robert Göffringmann | 2004-11-09 04:06:10 +0000 |
commit | 021f2cbccedfd2ed197bb4c54c3d5cf1fc3ca89f (patch) | |
tree | 44168e257d52b634893f7d01e3ed717fb0326bef /sword1/menu.cpp | |
parent | daee2edcfea567456bc94534e1cadcd988b6ad69 (diff) | |
download | scummvm-rg350-021f2cbccedfd2ed197bb4c54c3d5cf1fc3ca89f.tar.gz scummvm-rg350-021f2cbccedfd2ed197bb4c54c3d5cf1fc3ca89f.tar.bz2 scummvm-rg350-021f2cbccedfd2ed197bb4c54c3d5cf1fc3ca89f.zip |
free memory on quit.
Still leaks some, though
svn-id: r15735
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(); |