aboutsummaryrefslogtreecommitdiff
path: root/engines/lab
diff options
context:
space:
mode:
authorFilippos Karapetis2015-12-08 16:55:04 +0200
committerWillem Jan Palenstijn2015-12-23 21:33:56 +0100
commitc4ca8223b73060d8ae38977fe0624ed7a3d920aa (patch)
tree9f6e79b150442bb062d638c7c04bd373161f3be2 /engines/lab
parent6230fcbeb9e19c1db8bf50dd06fc02ffee925c01 (diff)
downloadscummvm-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.cpp7
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();