[Scummvm-cvs-logs] scummvm master -> 4d83a53e52be33845ca61fa10258fe75692c59e7

tramboi bertrand_augereau at yahoo.fr
Sun Dec 4 15:47:15 CET 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:
4d83a53e52 DREAMWEB: Cleaner finalization of the engine


Commit: 4d83a53e52be33845ca61fa10258fe75692c59e7
    https://github.com/scummvm/scummvm/commit/4d83a53e52be33845ca61fa10258fe75692c59e7
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-12-04T08:46:36-08:00

Commit Message:
DREAMWEB: Cleaner finalization of the engine
All the segments are destroyed with the VM but it won't be the case when individual buffers will be malloc'ed.

Changed paths:
    engines/dreamweb/stubs.cpp



diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index a498c90..b50710c 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -530,7 +530,7 @@ void DreamGenContext::dreamweb() {
 			setMode();
 			decide();
 			if (quitRequested())
-				return; // exit game
+				goto done;
 
 			if (data.byte(kGetback) == 4)
 				startNewGame = false; // savegame has been loaded
@@ -544,14 +544,14 @@ void DreamGenContext::dreamweb() {
 
 			titles();
 			if (quitRequested())
-				return; // exit game
+				goto done;
 
 			// "credits"
 			clearPalette();
 			realCredits();
 
 			if (quitRequested())
-				return; // exit game
+				goto done;
 
 			clearChanges();
 			setMode();
@@ -579,12 +579,12 @@ void DreamGenContext::dreamweb() {
 		while (true) {
 
 			if (quitRequested())
-				return; // exit game
+				goto done;
 
 			screenUpdate();
 
 			if (quitRequested())
-				return; // exit game
+				goto done;
 
 			if (data.byte(kWongame) != 0) {
 				// "endofgame"
@@ -593,7 +593,7 @@ void DreamGenContext::dreamweb() {
 				hangOn(200);
 				endGame();
 				quickQuit2();
-				return;
+				goto done;
 			}
 
 			if (data.byte(kMandead) == 1 || data.byte(kMandead) == 2)
@@ -633,6 +633,10 @@ void DreamGenContext::dreamweb() {
 		hangOn(100);
 
 	}
+done: // The engine will need some cleaner finalization, let's put it here for now
+	getRidOfAll();
+	deallocateMem(data.word(kIcons1));
+	deallocateMem(data.word(kIcons2));
 }
 
 bool DreamGenContext::quitRequested() {






More information about the Scummvm-git-logs mailing list