[Scummvm-cvs-logs] scummvm master -> 80ae039d7a40a77061ae289234f1ffbd81c79ed0

digitall digitall at scummvm.org
Sat May 7 16:19:11 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
80ae039d7a TSAGE: Close Memory Leak in GfxSurface::create().


Commit: 80ae039d7a40a77061ae289234f1ffbd81c79ed0
    https://github.com/scummvm/scummvm/commit/80ae039d7a40a77061ae289234f1ffbd81c79ed0
Author: D G Turner (digitall at scummvm.org)
Date: 2011-05-07T07:17:12-07:00

Commit Message:
TSAGE: Close Memory Leak in GfxSurface::create().

Changed paths:
    engines/tsage/graphics.cpp



diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index 723e50d..0a1e1ee 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);






More information about the Scummvm-git-logs mailing list