[FileSystem] Correctly free iwds
This commit is contained in:
parent
bab063a974
commit
6b3ff8fd00
@ -263,10 +263,18 @@ namespace Components
|
||||
void FileSystem::FsRestartSync(int a1, int a2)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(FileSystem::FSMutex);
|
||||
Maps::GetUserMap()->freeIwd();
|
||||
Utils::Hook::Call<void(int, int)>(0x461A50)(a1, a2); // FS_Restart
|
||||
Maps::GetUserMap()->reloadIwd();
|
||||
}
|
||||
|
||||
void FileSystem::FsShutdownSync(int a1)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(FileSystem::FSMutex);
|
||||
Maps::GetUserMap()->freeIwd();
|
||||
Utils::Hook::Call<void(int)>(0x4A46C0)(a1); // FS_Shutdown
|
||||
}
|
||||
|
||||
void FileSystem::DelayLoadImagesSync()
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> _(FileSystem::FSMutex);
|
||||
@ -322,6 +330,10 @@ namespace Components
|
||||
Utils::Hook(0x4C8609, FileSystem::FsRestartSync, HOOK_CALL).install()->quick(); // FS_ConditionalRestart
|
||||
Utils::Hook(0x5AC68E, FileSystem::FsRestartSync, HOOK_CALL).install()->quick(); // CL_ParseServerMessage
|
||||
|
||||
// Synchronize filesystem stops
|
||||
Utils::Hook(0x461A55, FileSystem::FsShutdownSync, HOOK_CALL).install()->quick(); // FS_Restart
|
||||
Utils::Hook(0x4D40DB, FileSystem::FsShutdownSync, HOOK_CALL).install()->quick(); // Com_Quitf
|
||||
|
||||
// Synchronize db image loading
|
||||
Utils::Hook(0x415AB8, FileSystem::DelayLoadImagesSync, HOOK_CALL).install()->quick();
|
||||
Utils::Hook(0x4D32BC, FileSystem::LoadTextureSync, HOOK_CALL).install()->quick();
|
||||
|
@ -109,6 +109,7 @@ namespace Components
|
||||
|
||||
static void FsStartupSync(const char* a1);
|
||||
static void FsRestartSync(int a1, int a2);
|
||||
static void FsShutdownSync(int a1);
|
||||
static void DelayLoadImagesSync();
|
||||
static int LoadTextureSync(Game::GfxImageLoadDef **loadDef, Game::GfxImage *image);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user