diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-04-22 15:57:03 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-04-22 15:57:03 +0100 |
| commit | dafc9ed4eb225e87d09cc92273dd390b8a15dbd0 (patch) | |
| tree | b526a845105491cd8223a41ef1ecd150827d56cc /src/plugins/PluginSystem.cpp | |
| parent | e91513a5e8953cfbb69320d94e495ccf2d4d58f3 (diff) | |
pluginsystem: fix unhooking on exit
Diffstat (limited to 'src/plugins/PluginSystem.cpp')
| -rw-r--r-- | src/plugins/PluginSystem.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/PluginSystem.cpp b/src/plugins/PluginSystem.cpp index 95a82dde..1703222b 100644 --- a/src/plugins/PluginSystem.cpp +++ b/src/plugins/PluginSystem.cpp @@ -96,8 +96,10 @@ void CPluginSystem::unloadPlugin(const CPlugin* plugin, bool eject) { exitFunc(); } - for (auto& [k, v] : plugin->registeredCallbacks) - g_pHookSystem->unhook(v); + for (auto& [k, v] : plugin->registeredCallbacks) { + if (const auto SP = v.lock()) + g_pHookSystem->unhook(SP); + } const auto ls = plugin->registeredLayouts; for (auto& l : ls) |
