mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 18:53:40 +01:00
Fix UAF in removeFromParentRecursive
This commit is contained in:
parent
1c98666342
commit
2a2cb5c8a0
1 changed files with 2 additions and 1 deletions
|
@ -332,6 +332,7 @@ Hy3Node* Hy3Node::removeFromParentRecursive() {
|
|||
group.lastFocusedChild = group.children.front();
|
||||
}
|
||||
|
||||
auto child_size_ratio = child->size_ratio;
|
||||
if (child != this) {
|
||||
parent->layout->nodes.remove(*child);
|
||||
} else {
|
||||
|
@ -344,7 +345,7 @@ Hy3Node* Hy3Node::removeFromParentRecursive() {
|
|||
child_count -= 1;
|
||||
}
|
||||
|
||||
auto splitmod = -((1.0 - child->size_ratio) / child_count);
|
||||
auto splitmod = -((1.0 - child_size_ratio) / child_count);
|
||||
|
||||
for (auto* child: group.children) {
|
||||
child->size_ratio += splitmod;
|
||||
|
|
Loading…
Add table
Reference in a new issue