[Scummvm-cvs-logs] SF.net SVN: scummvm:[55686] scummvm/trunk/engines/teenagent/resources.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Jan 31 16:25:29 CET 2011


Revision: 55686
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55686&view=rev
Author:   thebluegr
Date:     2011-01-31 15:25:29 +0000 (Mon, 31 Jan 2011)

Log Message:
-----------
TEENAGENT: Hopefully fixed an issue reported by Valgrind (found by digitall)

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/resources.cpp

Modified: scummvm/trunk/engines/teenagent/resources.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/resources.cpp	2011-01-31 15:05:45 UTC (rev 55685)
+++ scummvm/trunk/engines/teenagent/resources.cpp	2011-01-31 15:25:29 UTC (rev 55686)
@@ -63,19 +63,20 @@
 */
 
 bool Resources::loadArchives(const ADGameDescription *gd) {
-	Common::File dat_file;
-	if (!dat_file.open("teenagent.dat")) {
+	Common::File *dat_file = new Common::File();
+	if (!dat_file->open("teenagent.dat")) {
+		delete dat_file;
 		Common::String errorMessage = "You're missing the 'teenagent.dat' file. Get it from the ScummVM website";
 		GUIErrorMessage(errorMessage);
 		warning("%s", errorMessage.c_str());
 		return false;
 	}
-	Common::SeekableReadStream *dat = Common::wrapCompressedReadStream(&dat_file);
+	Common::SeekableReadStream *dat = Common::wrapCompressedReadStream(dat_file);
 	cseg.read(dat, 0xb3b0);
 	dseg.read(dat, 0xe790);
 	eseg.read(dat, 0x8be2);
 
-	dat_file.close();
+	delete dat;
 
 	{
 		FilePack varia;


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