summaryrefslogtreecommitdiff
path: root/src/plugins/PluginSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/PluginSystem.cpp')
-rw-r--r--src/plugins/PluginSystem.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/PluginSystem.cpp b/src/plugins/PluginSystem.cpp
index 53b05bc8..0549c81b 100644
--- a/src/plugins/PluginSystem.cpp
+++ b/src/plugins/PluginSystem.cpp
@@ -171,8 +171,10 @@ void CPluginSystem::unloadPlugin(const CPlugin* plugin, bool eject) {
HyprlandAPI::removeDispatcher(plugin->m_handle, d);
const auto rhc = plugin->m_registeredHyprctlCommands;
- for (auto const& c : rhc)
- HyprlandAPI::unregisterHyprCtlCommand(plugin->m_handle, c);
+ for (auto const& c : rhc) {
+ if (const auto sp = c.lock())
+ HyprlandAPI::unregisterHyprCtlCommand(plugin->m_handle, sp);
+ }
g_pConfigManager->removePluginConfig(plugin->m_handle);