1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Fix heap-use-after-free when changing 2D editor selection

This commit is contained in:
Haoyu Qiu
2025-02-07 09:30:02 +08:00
parent 06acfccf89
commit 577f90feba

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) {