From 922e53c68c32a030c410781829e5e3acab5d7762 Mon Sep 17 00:00:00 2001 From: Virt <41426325+VirtCode@users.noreply.github.com> Date: Sat, 3 Jan 2026 22:11:05 +0100 Subject: pluginsystem: fix crash when unloading plugin hyprctl commands (#12821) --- src/plugins/PluginSystem.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins/PluginSystem.cpp') 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); -- cgit v1.2.3