[Scummvm-cvs-logs] SF.net SVN: scummvm:[46416] scummvm/trunk/engines/sci/engine/game.cpp

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Sat Dec 19 03:12:17 CET 2009


Revision: 46416
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46416&view=rev
Author:   mthreepwood
Date:     2009-12-19 02:12:17 +0000 (Sat, 19 Dec 2009)

Log Message:
-----------
Fix segfault when quitting. static const Common::String's shouldn't be used.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/game.cpp

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-12-19 02:03:41 UTC (rev 46415)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-12-19 02:12:17 UTC (rev 46416)
@@ -43,10 +43,10 @@
 namespace Sci {
 
 struct OldNewIdTableEntry {
-	Common::String oldId;
-	Common::String newId;
+	const char *oldId;
+	const char *newId;
 	bool demo;
-	Common::String demoCheckFile;	// if not empty and it doesn't exist, the demo flag is set
+	const char *demoCheckFile;	// if not empty and it doesn't exist, the demo flag is set
 };
 
 static const OldNewIdTableEntry s_oldNewTable[] = {
@@ -101,14 +101,14 @@
 
 	// TODO: SCI32 IDs
 
-	for (const OldNewIdTableEntry *cur = s_oldNewTable; !cur->oldId.empty(); ++cur) {
+	for (const OldNewIdTableEntry *cur = s_oldNewTable; cur->oldId[0]; ++cur) {
 		if (sierraId == cur->oldId) {
 			if (cur->demo)
 				*gameFlags |= ADGF_DEMO;
-			if (!cur->demoCheckFile.empty())
-				if (!Common::File::exists(cur->demoCheckFile.c_str()))
+			if (cur->demoCheckFile[0])
+				if (!Common::File::exists(cur->demoCheckFile))
 					*gameFlags |= ADGF_DEMO;
-			return cur->newId.c_str();
+			return cur->newId;
 		}
 	}
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list