1
0
mirror of https://github.com/hyprwm/Hyprland.git synced 2025-08-14 11:35:46 -07:00

keybinds: fix nullptr deref in forcekillactive ()

This commit is contained in:
littleblack111
2025-01-10 23:16:52 +08:00
committed by GitHub
parent 8475a8ef99
commit da9252a23e

@@ -983,7 +983,14 @@ uint64_t CKeybindManager::spawnRawProc(std::string args, PHLWORKSPACE pInitialWo
}
SDispatchResult CKeybindManager::killActive(std::string args) {
kill(g_pCompositor->m_pLastWindow.lock()->getPID(), SIGKILL);
const auto PWINDOW = g_pCompositor->m_pLastWindow.lock();
if (!PWINDOW) {
Debug::log(ERR, "killActive: no window found");
return {.success = false, .error = "killActive: no window found"};
}
kill(PWINDOW->getPID(), SIGKILL);
return {};
}