summaryrefslogtreecommitdiff
path: root/src/plugins/PluginSystem.cpp
diff options
context:
space:
mode:
authorVirt <41426325+VirtCode@users.noreply.github.com>2026-01-03 22:11:05 +0100
committerGitHub <noreply@github.com>2026-01-03 22:11:05 +0100
commit922e53c68c32a030c410781829e5e3acab5d7762 (patch)
tree304aa0fed8564f46ae39bd7620dea491246d7630 /src/plugins/PluginSystem.cpp
parent17bc3b83db885e5af611bb11f4fc79672e216e52 (diff)
pluginsystem: fix crash when unloading plugin hyprctl commands (#12821)
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);