diff --git a/source/main.cpp b/source/main.cpp index d121a63..368fb95 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -28,6 +28,7 @@ #include #include +#include #include WUMS_MODULE_EXPORT_NAME("homebrew_wupsbackend"); @@ -309,9 +310,12 @@ void CleanupPlugins(std::vector &&pluginsToDeinit) { if (!pluginContainer.isLinkedAndLoaded() || cur.id != pluginContainer.getPluginLinkInformation().getTrampolineId()) { continue; } - cur.status = RELOC_TRAMP_FREE; + cur = {}; } } + DCFlushRange((void *) gTrampData.data(), gTrampData.size() * sizeof(relocation_trampoline_entry_t)); + ICInvalidateRange((void *) gTrampData.data(), gTrampData.size() * sizeof(relocation_trampoline_entry_t)); + OSMemoryBarrier(); } void CheckCleanupCallbackUsage(const std::vector &plugins) { auto *curThread = OSGetCurrentThread();