1
0
Fork 0

Free module file handles upon cleanup

This commit is contained in:
RaMMicHaeL 2016-03-05 13:19:00 +02:00
parent 50aa0b83ab
commit 6e9b125351
1 changed files with 10 additions and 0 deletions

View File

@ -184,7 +184,17 @@ void ModClear()
{
// Clean up all the modules
EXCLUSIVE_ACQUIRE(LockModules);
for(const auto & mod : modinfo)
{
// Unload the mapped file from memory
const auto & info = mod.second;
if(info.fileMapVA)
StaticFileUnloadW(StringUtils::Utf8ToUtf16(info.path).c_str(), false, info.fileHandle, info.loadedSize, info.fileMap, info.fileMapVA);
}
modinfo.clear();
EXCLUSIVE_RELEASE();
// Tell the symbol updater