[Scummvm-cvs-logs] CVS: scummvm/common main.cpp,1.36,1.37

Chris Apers chrilith at users.sourceforge.net
Wed Aug 20 02:03:10 CEST 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv14755

Modified Files:
	main.cpp 
Log Message:
Fix 1 memory leak + 102 memory leaks using launcher

Index: main.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/main.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- main.cpp	1 Aug 2003 12:18:35 -0000	1.36
+++ main.cpp	19 Aug 2003 15:03:27 -0000	1.37
@@ -200,10 +200,8 @@
 		launcherDialog(detector, system);
 
 	// Verify the given game name
-	if (detector.detectMain()) {
-		system->quit();
-		return -1;
-	}
+	if (detector.detectMain())
+		goto exitNow;
 
 	// Set the window caption to the game name
 	prop.caption = g_config->get("description", detector._gameFileName);
@@ -217,7 +215,7 @@
 		prop.gfx_mode = GFX_NORMAL;
 		system->property(OSystem::PROP_SET_GFX_MODE, &prop);
 	}
-	
+
 	// Create the game engine
 	Engine *engine = Engine::createFromDetector(&detector, system);
 
@@ -234,12 +232,14 @@
 
 	// Free up memory
 	delete engine;
+exitNow:
 	delete g_gui;
 	delete g_config;
 
 	// ...and quit (the return 0 should never be reached)
 	system->quit();
-	delete system;	// palmos leaks
+	delete system;
+	free((void *)version_settings); // allocated in GameDetector
 	return 0;
 }
 





More information about the Scummvm-git-logs mailing list