1
0
Fork 0

Merge pull request #102510 from timothyqiu/selection-erase

Fix heap-use-after-free when changing 2D editor selection
This commit is contained in:
Thaddeus Crews 2025-02-07 14:50:35 -06:00
commit 29ded6b031
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84
1 changed files with 5 additions and 3 deletions

View File

@ -3659,10 +3659,12 @@ void CanvasItemEditor::_draw_selection() {
}
// Remove non-movable nodes.
for (CanvasItem *ci : selection) {
if (!_is_node_movable(ci)) {
selection.erase(ci);
for (List<CanvasItem *>::Element *E = selection.front(); E;) {
List<CanvasItem *>::Element *N = E->next();
if (!_is_node_movable(E->get())) {
selection.erase(E);
}
E = N;
}
if (!selection.is_empty() && transform_tool && show_transformation_gizmos) {