Call the DEINIT_HOOK before restoring the function patches

This commit is contained in:
Maschell 2022-12-30 21:08:22 +01:00
parent 4f191a797b
commit bd0a6ce3bf

View File

@ -92,9 +92,9 @@ WUMS_APPLICATION_STARTS() {
} }
if (!gLoadOnNextLaunch.empty()) { if (!gLoadOnNextLaunch.empty()) {
CallHook(gLoadedPlugins, WUPS_LOADER_HOOK_DEINIT_PLUGIN);
DEBUG_FUNCTION_LINE("Restore function patches of currently loaded plugins."); DEBUG_FUNCTION_LINE("Restore function patches of currently loaded plugins.");
PluginManagement::RestoreFunctionPatches(gLoadedPlugins); PluginManagement::RestoreFunctionPatches(gLoadedPlugins);
CallHook(gLoadedPlugins, WUPS_LOADER_HOOK_DEINIT_PLUGIN);
DEBUG_FUNCTION_LINE("Unload existing plugins."); DEBUG_FUNCTION_LINE("Unload existing plugins.");
gLoadedPlugins.clear(); gLoadedPlugins.clear();
memset(gTrampData, 0, sizeof(relocation_trampoline_entry_t) * TRAMP_DATA_SIZE); memset(gTrampData, 0, sizeof(relocation_trampoline_entry_t) * TRAMP_DATA_SIZE);