diff options
author | Filippos Karapetis | 2015-12-08 16:55:04 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:33:56 +0100 |
commit | c4ca8223b73060d8ae38977fe0624ed7a3d920aa (patch) | |
tree | 9f6e79b150442bb062d638c7c04bd373161f3be2 /engines/lab | |
parent | 6230fcbeb9e19c1db8bf50dd06fc02ffee925c01 (diff) | |
download | scummvm-rg350-c4ca8223b73060d8ae38977fe0624ed7a3d920aa.tar.gz scummvm-rg350-c4ca8223b73060d8ae38977fe0624ed7a3d920aa.tar.bz2 scummvm-rg350-c4ca8223b73060d8ae38977fe0624ed7a3d920aa.zip |
LAB: Plug a memory leak in freeButtonList()
Diffstat (limited to 'engines/lab')
-rw-r--r-- | engines/lab/interface.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp index d041160349..dae822b8ff 100644 --- a/engines/lab/interface.cpp +++ b/engines/lab/interface.cpp @@ -56,8 +56,11 @@ Gadget *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im, Image } void freeButtonList(GadgetList *gadgetList) { - for (GadgetList::iterator gadget = gadgetList->begin(); gadget != gadgetList->end(); ++gadget) { - delete *gadget; + for (GadgetList::iterator gadgetIter = gadgetList->begin(); gadgetIter != gadgetList->end(); ++gadgetIter) { + Gadget *gadget = *gadgetIter; + delete gadget->_image; + delete gadget->_altImage; + delete gadget; } gadgetList->clear(); |