diff --git a/source/lib/res/unifont.cpp b/source/lib/res/unifont.cpp index 9ff099317c..f6f7023e68 100755 --- a/source/lib/res/unifont.cpp +++ b/source/lib/res/unifont.cpp @@ -1,5 +1,5 @@ /* -$Id: unifont.cpp,v 1.10 2004/07/24 14:03:25 philip Exp $ +$Id: unifont.cpp,v 1.11 2004/07/29 16:11:33 philip Exp $ Unicode OpenGL texture font @@ -66,14 +66,17 @@ static int UniFont_reload(UniFont* f, const char* fn, Handle UNUSEDPARAM(h)) size_t FNTSize; std::string FilenameFnt = FilenameBase+".fnt"; const char* fnt_fn = FilenameFnt.c_str(); - Handle err = vfs_load(fnt_fn, RawFNT, FNTSize); + Handle fh = vfs_load(fnt_fn, RawFNT, FNTSize); - if (err <= 0) - return (int)err; + if (fh <= 0) + return (int)fh; // Get the data in a nicer object std::istringstream FNTStream (std::string((char*)RawFNT, (int)FNTSize)); + // Unload the file + mem_free_h(fh); + int Version; FNTStream >> Version; assert (Version == 100); // Make sure this is from a recent version of the font builder diff --git a/source/ps/ConfigDB.cpp b/source/ps/ConfigDB.cpp index bdf7656225..e8454a5ee3 100755 --- a/source/ps/ConfigDB.cpp +++ b/source/ps/ConfigDB.cpp @@ -6,6 +6,7 @@ #include "CLogger.h" #include "res/vfs.h" #include "res/file.h" +#include "res/mem.h" #include "scripting/ScriptingHost.h" #include "types.h" @@ -321,7 +322,7 @@ bool CConfigDB::Reload(EConfigNamespace ns) // Close the correct file handle if (m_UseVFS[ns]) { - vfs_close(fh); + mem_free_h(fh); } else { diff --git a/source/sound/CMusicPlayer.cpp b/source/sound/CMusicPlayer.cpp index efa9a252b6..22b6bb7e48 100755 --- a/source/sound/CMusicPlayer.cpp +++ b/source/sound/CMusicPlayer.cpp @@ -147,6 +147,7 @@ void CMusicPlayer::open(char *filename) size_t sizeOfFile; if(vfs_load(filename, p, sizeOfFile) <= 0) return; + // TODO maybe: Free the mem handle returned by vfs_load (using mem_free_h) ?? memFile.dataPtr = (char*)p; memFile.dataRead = 0;