aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure/gui.cpp
diff options
context:
space:
mode:
authorBorja Lorente2016-08-13 16:57:42 +0200
committerBorja Lorente2016-08-19 16:29:17 +0200
commit44a6f8a1dbdfa271aaa9ccf4b1ecc48e275ca11a (patch)
treea71afc88f925667dcd30c75395783abb67d1a5a2 /engines/macventure/gui.cpp
parent479f01b5a708ed1e3294ef1d553d37d270cb97c4 (diff)
downloadscummvm-rg350-44a6f8a1dbdfa271aaa9ccf4b1ecc48e275ca11a.tar.gz
scummvm-rg350-44a6f8a1dbdfa271aaa9ccf4b1ecc48e275ca11a.tar.bz2
scummvm-rg350-44a6f8a1dbdfa271aaa9ccf4b1ecc48e275ca11a.zip
MACVENTURE: Fix minor memory leaks
Diffstat (limited to 'engines/macventure/gui.cpp')
-rw-r--r--engines/macventure/gui.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 85f1cdbea7..f8f9497b8b 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -138,6 +138,9 @@ Gui::~Gui() {
delete _dialog;
clearAssets();
+
+ if (_graphics)
+ delete _graphics;
}
void Gui::initGUI() {
@@ -421,6 +424,7 @@ bool Gui::loadMenus() {
}
i++;
+ delete res;
}
return true;
@@ -463,12 +467,15 @@ bool Gui::loadWindows() {
res->read(newTitle, data.titleLength);
newTitle[data.titleLength] = '\0';
data.title = Common::String(newTitle);
+ delete[] newTitle;
}
data.scrollPos = Common::Point(0, 0);
debugC(4, kMVDebugGUI, "Window loaded: %s", data.title.c_str());
_windowData->push_back(data);
+
+ delete res;
}
return true;
@@ -518,7 +525,9 @@ bool Gui::loadControls() {
}
- i++;
+ _controlData->push_back(CommandButton(data, this));
+
+ delete res;
}
return true;