void RemoveFile( M_OutputFile& files, const tstring& fileName ) { Helium::MutexScopeLock mutex (g_Mutex); M_OutputFile::iterator found = files.find( fileName ); if ( found != files.end() ) { found->second.m_RefCount--; if ( found->second.m_RefCount == 0 ) { g_FileManager.Close( fileName ); files.erase( found ); } } }