aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage
diff options
context:
space:
mode:
authorD G Turner2011-05-07 15:17:12 +0100
committerD G Turner2011-05-07 15:17:12 +0100
commit80ae039d7a40a77061ae289234f1ffbd81c79ed0 (patch)
treeac5dd6bd3498e65ff0947d4b795908145aaf9004 /engines/tsage
parent473337effd7992940c0e84e5dc85062d03fa47c0 (diff)
downloadscummvm-rg350-80ae039d7a40a77061ae289234f1ffbd81c79ed0.tar.gz
scummvm-rg350-80ae039d7a40a77061ae289234f1ffbd81c79ed0.tar.bz2
scummvm-rg350-80ae039d7a40a77061ae289234f1ffbd81c79ed0.zip
TSAGE: Close Memory Leak in GfxSurface::create().
Diffstat (limited to 'engines/tsage')
-rw-r--r--engines/tsage/graphics.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index 723e50d338..0a1e1eeaa4 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -258,6 +258,10 @@ void GfxSurface::setScreenSurface() {
void GfxSurface::create(int width, int height) {
assert((width >= 0) && (height >= 0));
_screenSurface = false;
+ if (_customSurface) {
+ _customSurface->free();
+ delete _customSurface;
+ }
_customSurface = new Graphics::Surface();
_customSurface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
Common::set_to((byte *)_customSurface->pixels, (byte *)_customSurface->pixels + (width * height), 0);