mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 07:01:57 -07:00
fix memory read-after-free in master layout
This commit is contained in:
@@ -152,11 +152,13 @@ void CHyprMasterLayout::onWindowRemovedTiling(CWindow* pWindow) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto WORKSPACEID = PNODE->workspaceID;
|
||||||
|
|
||||||
m_lMasterNodesData.remove(*PNODE);
|
m_lMasterNodesData.remove(*PNODE);
|
||||||
|
|
||||||
if (getMastersOnWorkspace(PNODE->workspaceID) == getNodesOnWorkspace(PNODE->workspaceID) && MASTERSLEFT > 1) {
|
if (getMastersOnWorkspace(WORKSPACEID) == getNodesOnWorkspace(WORKSPACEID) && MASTERSLEFT > 1) {
|
||||||
for (auto it = m_lMasterNodesData.rbegin(); it != m_lMasterNodesData.rend(); it++) {
|
for (auto it = m_lMasterNodesData.rbegin(); it != m_lMasterNodesData.rend(); it++) {
|
||||||
if (it->workspaceID == PNODE->workspaceID) {
|
if (it->workspaceID == WORKSPACEID) {
|
||||||
it->isMaster = false;
|
it->isMaster = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user