aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/nebular/dialogs_nebular.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2015-04-09 13:44:39 +0300
committerFilippos Karapetis2015-04-09 13:44:39 +0300
commitec999f1cb74dff8c42c69898bb6cbc3823b169dd (patch)
treed0c3fd1f268f788700cf719785bd5ef6133fe1d4 /engines/mads/nebular/dialogs_nebular.cpp
parent47afe424c194d5d4fd1797948b53f999473fe922 (diff)
downloadscummvm-rg350-ec999f1cb74dff8c42c69898bb6cbc3823b169dd.tar.gz
scummvm-rg350-ec999f1cb74dff8c42c69898bb6cbc3823b169dd.tar.bz2
scummvm-rg350-ec999f1cb74dff8c42c69898bb6cbc3823b169dd.zip
MADS: Plug some memory leaks
Surfaces should be freed (to free their inner allocated surface buffers) before being deleted
Diffstat (limited to 'engines/mads/nebular/dialogs_nebular.cpp')
-rw-r--r--engines/mads/nebular/dialogs_nebular.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index 10715797ed..5b9942db07 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -430,7 +430,7 @@ void CopyProtectionDialog::show() {
draw();
Common::KeyState curKey;
- Common::Rect inputArea(110, 165, 210, 175);
+ const Common::Rect inputArea(110, 165, 210, 175);
MSurface *origInput = new MSurface(inputArea.width(), inputArea.height());
_vm->_screen.frameRect(inputArea, TEXTDIALOG_BLACK);
_vm->_screen.copyTo(origInput, inputArea, Common::Point(0, 0));
@@ -471,6 +471,7 @@ void CopyProtectionDialog::show() {
_vm->_screen.updateScreen();
}
+ origInput->free();
delete origInput;
}
@@ -592,6 +593,7 @@ void PictureDialog::save() {
void PictureDialog::restore() {
if (_savedSurface) {
_savedSurface->copyTo(&_vm->_screen);
+ _savedSurface->free();
delete _savedSurface;
_savedSurface = nullptr;