pluginsystem: fix unhooking on exit

This commit is contained in:
Vaxry 2024-04-22 15:57:03 +01:00
parent e91513a5e8
commit dafc9ed4eb

View file

@ -96,8 +96,10 @@ void CPluginSystem::unloadPlugin(const CPlugin* plugin, bool eject) {
exitFunc(); exitFunc();
} }
for (auto& [k, v] : plugin->registeredCallbacks) for (auto& [k, v] : plugin->registeredCallbacks) {
g_pHookSystem->unhook(v); if (const auto SP = v.lock())
g_pHookSystem->unhook(SP);
}
const auto ls = plugin->registeredLayouts; const auto ls = plugin->registeredLayouts;
for (auto& l : ls) for (auto& l : ls)