Skip to content

Commit

Permalink
Merge pull request #99800 from amarsero/bone2d-redo-crash
Browse files Browse the repository at this point in the history
Fix use after free in redo of "Create Custom Bone2D(s) from Node(s)"
  • Loading branch information
Repiteo committed Dec 30, 2024
2 parents b98eeb3 + d514ab2 commit e55ea94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/plugins/canvas_item_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4843,11 +4843,12 @@ void CanvasItemEditor::_popup_callback(int p_op) {
undo_redo->add_do_method(new_bone, "add_child", n2d);
undo_redo->add_do_method(n2d, "set_transform", Transform2D());
undo_redo->add_do_method(this, "_set_owner_for_node_and_children", new_bone, editor_root);
undo_redo->add_do_reference(new_bone);

undo_redo->add_undo_method(new_bone, "remove_child", n2d);
undo_redo->add_undo_method(n2d_parent, "add_child", n2d);
undo_redo->add_undo_method(n2d_parent, "remove_child", new_bone);
undo_redo->add_undo_method(n2d, "set_transform", new_bone->get_transform());
undo_redo->add_undo_method(new_bone, "queue_free");
undo_redo->add_undo_method(this, "_set_owner_for_node_and_children", n2d, editor_root);
}
undo_redo->commit_action();
Expand Down

0 comments on commit e55ea94

Please sign in to comment.