[Scummvm-cvs-logs] scummvm master -> 246d48b467cd88d666311bf95b3c966a53eaf0da

eriktorbjorn eriktorbjorn at telia.com
Fri Jul 15 11:49:22 CEST 2016


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

Summary:
9284204cf6 WAGE: Free memory for buttons when dialog is destroyed
72269b6c9d WAGE: Fix memory leak in drawBitmap()
246d48b467 WAGE: Free memory used by loadWorld() debug code


Commit: 9284204cf698dc75cd5efac84e6a0f2ba792e857
    https://github.com/scummvm/scummvm/commit/9284204cf698dc75cd5efac84e6a0f2ba792e857
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2016-07-15T11:24:05+02:00

Commit Message:
WAGE: Free memory for buttons when dialog is destroyed

Changed paths:
    engines/wage/dialog.cpp



diff --git a/engines/wage/dialog.cpp b/engines/wage/dialog.cpp
index d9bb3e6..86080c9 100644
--- a/engines/wage/dialog.cpp
+++ b/engines/wage/dialog.cpp
@@ -86,6 +86,8 @@ Dialog::Dialog(Gui *gui, int width, const char *text, DialogButtonArray *buttons
 }
 
 Dialog::~Dialog() {
+	for (uint i = 0; i < _buttons->size(); i++)
+		delete _buttons->operator[](i);
 }
 
 const Graphics::Font *Dialog::getDialogFont() {


Commit: 72269b6c9da89de835df5a7e3e083dfd7cd0b432
    https://github.com/scummvm/scummvm/commit/72269b6c9da89de835df5a7e3e083dfd7cd0b432
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2016-07-15T11:29:19+02:00

Commit Message:
WAGE: Fix memory leak in drawBitmap()

The 'tmp' surface was never freed when in _boundsCalculationMode.

Changed paths:
    engines/wage/design.cpp



diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp
index f2a8aba..2bfea9d 100644
--- a/engines/wage/design.cpp
+++ b/engines/wage/design.cpp
@@ -474,28 +474,27 @@ void Design::drawBitmap(Graphics::ManagedSurface *surface, Common::SeekableReadS
 
 	in.skip(numBytes);
 
-	if (_boundsCalculationMode)
-		return;
-
-	Graphics::FloodFill ff(&tmp, kColorWhite, kColorGreen);
-	for (int yy = 0; yy < h; yy++) {
-		ff.addSeed(0, yy);
-		ff.addSeed(w - 1, yy);
-	}
-	for (int xx = 0; xx < w; xx++) {
-		ff.addSeed(xx, 0);
-		ff.addSeed(xx, h - 1);
-	}
-	ff.fill();
-
-	for (y = 0; y < h && y1 + y < surface->h; y++) {
-		byte *src = (byte *)tmp.getBasePtr(0, y);
-		byte *dst = (byte *)surface->getBasePtr(x1, y1 + y);
-		for (x = 0; x < w; x++) {
-			if (*src != kColorGreen)
-				*dst = *src;
-			src++;
-			dst++;
+	if (!_boundsCalculationMode) {
+		Graphics::FloodFill ff(&tmp, kColorWhite, kColorGreen);
+		for (int yy = 0; yy < h; yy++) {
+			ff.addSeed(0, yy);
+			ff.addSeed(w - 1, yy);
+		}
+		for (int xx = 0; xx < w; xx++) {
+			ff.addSeed(xx, 0);
+			ff.addSeed(xx, h - 1);
+		}
+		ff.fill();
+
+		for (y = 0; y < h && y1 + y < surface->h; y++) {
+			byte *src = (byte *)tmp.getBasePtr(0, y);
+			byte *dst = (byte *)surface->getBasePtr(x1, y1 + y);
+			for (x = 0; x < w; x++) {
+				if (*src != kColorGreen)
+					*dst = *src;
+				src++;
+				dst++;
+			}
 		}
 	}
 


Commit: 246d48b467cd88d666311bf95b3c966a53eaf0da
    https://github.com/scummvm/scummvm/commit/246d48b467cd88d666311bf95b3c966a53eaf0da
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2016-07-15T11:41:50+02:00

Commit Message:
WAGE: Free memory used by loadWorld() debug code

Changed paths:
    engines/wage/world.cpp



diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp
index 53fc1b4..716e197 100644
--- a/engines/wage/world.cpp
+++ b/engines/wage/world.cpp
@@ -119,6 +119,8 @@ bool World::loadWorld(Common::MacResManager *resMan) {
 	out.open("code.bin");
 	out.write(buf, res->size());
 	out.close();
+	free(buf);
+	delete res;
 #endif
 
 	if ((resArray = resMan->getResIDArray(MKTAG('G','C','O','D'))).size() == 0)






More information about the Scummvm-git-logs mailing list