diff options
author | Filippos Karapetis | 2011-01-31 15:25:29 +0000 |
---|---|---|
committer | Filippos Karapetis | 2011-01-31 15:25:29 +0000 |
commit | d45a2a97a3fee377f72e81da65f42925038450a5 (patch) | |
tree | 6c954671b6211abc41bf12e82a3907b316a58d8b /engines | |
parent | fc02bd37221f07646388fb2eb128f95a46ef6dd5 (diff) | |
download | scummvm-rg350-d45a2a97a3fee377f72e81da65f42925038450a5.tar.gz scummvm-rg350-d45a2a97a3fee377f72e81da65f42925038450a5.tar.bz2 scummvm-rg350-d45a2a97a3fee377f72e81da65f42925038450a5.zip |
TEENAGENT: Hopefully fixed an issue reported by Valgrind (found by digitall)
svn-id: r55686
Diffstat (limited to 'engines')
-rw-r--r-- | engines/teenagent/resources.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/teenagent/resources.cpp b/engines/teenagent/resources.cpp index 0a59c0b368..9fe889fa41 100644 --- a/engines/teenagent/resources.cpp +++ b/engines/teenagent/resources.cpp @@ -63,19 +63,20 @@ quick note on varia resources: */ 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; |