aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorJohannes Schickel2012-06-29 15:55:46 +0200
committerJohannes Schickel2012-06-29 15:55:46 +0200
commit37fd9b7384e8b7eda1a1966ccdab642357078a6b (patch)
treec9368e7d26350101da8f8a34f481f6f329053b99 /gui
parentd3e5763276826d3f469fd93077c2f1ef6ef61314 (diff)
downloadscummvm-rg350-37fd9b7384e8b7eda1a1966ccdab642357078a6b.tar.gz
scummvm-rg350-37fd9b7384e8b7eda1a1966ccdab642357078a6b.tar.bz2
scummvm-rg350-37fd9b7384e8b7eda1a1966ccdab642357078a6b.zip
GUI: Fix memory leaks in LoadChooserThumbnailed::destroyButtons.
GuiObject::removeWidget only removes the widget from the widget list, but doesn't delete it. Oops.
Diffstat (limited to 'gui')
-rw-r--r--gui/saveload-dialog.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp
index 45bf1c49fc..1a6083bf9e 100644
--- a/gui/saveload-dialog.cpp
+++ b/gui/saveload-dialog.cpp
@@ -595,8 +595,11 @@ int LoadChooserThumbnailed::runIntern() {
void LoadChooserThumbnailed::destroyButtons() {
for (ButtonArray::iterator i = _buttons.begin(), end = _buttons.end(); i != end; ++i) {
removeWidget(i->container);
+ delete i->container;
removeWidget(i->button);
+ delete i->button;
removeWidget(i->description);
+ delete i->description;
}
_buttons.clear();