From bd0a6ce3bf48837e45ad5e58dc34585d06b9c0c3 Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 30 Dec 2022 21:08:22 +0100 Subject: [PATCH] Call the DEINIT_HOOK before restoring the function patches --- source/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/main.cpp b/source/main.cpp index f130f4c..d603ce9 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -92,9 +92,9 @@ WUMS_APPLICATION_STARTS() { } if (!gLoadOnNextLaunch.empty()) { + CallHook(gLoadedPlugins, WUPS_LOADER_HOOK_DEINIT_PLUGIN); DEBUG_FUNCTION_LINE("Restore function patches of currently loaded plugins."); PluginManagement::RestoreFunctionPatches(gLoadedPlugins); - CallHook(gLoadedPlugins, WUPS_LOADER_HOOK_DEINIT_PLUGIN); DEBUG_FUNCTION_LINE("Unload existing plugins."); gLoadedPlugins.clear(); memset(gTrampData, 0, sizeof(relocation_trampoline_entry_t) * TRAMP_DATA_SIZE);