pluginsystem: fix crash when unloading plugin hyprctl commands (#12821)

This commit is contained in:
Virt 2026-01-03 22:11:05 +01:00 committed by GitHub
parent 17bc3b83db
commit 922e53c68c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 4 deletions

View file

@ -407,7 +407,7 @@ APICALL bool HyprlandAPI::unregisterHyprCtlCommand(HANDLE handle, SP<SHyprCtlCom
if (!PLUGIN)
return false;
std::erase(PLUGIN->m_registeredHyprctlCommands, cmd);
std::erase_if(PLUGIN->m_registeredHyprctlCommands, [&](const auto& other) { return !other || other == cmd; });
g_pHyprCtl->unregisterCommand(cmd);
return true;