mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
fix error where update wouldn't reconnect the signal it should have reconnected and led to errors and crash
This commit is contained in:
parent
61282068f4
commit
69e5e582c8
2 changed files with 14 additions and 10 deletions
|
|
@ -721,8 +721,12 @@ bool EditorData::check_and_update_scene(int p_idx) {
|
|||
}
|
||||
|
||||
new_scene->set_scene_file_path(edited_scene[p_idx].root->get_scene_file_path());
|
||||
|
||||
memdelete(edited_scene[p_idx].root);
|
||||
Node *old_root = edited_scene[p_idx].root;
|
||||
for (int i = 0; i < old_root->get_child_count(); i++) {
|
||||
memdelete(old_root->get_child(i));
|
||||
}
|
||||
old_root->replace_by(new_scene);
|
||||
memdelete(old_root);
|
||||
edited_scene.write[p_idx].root = new_scene;
|
||||
if (!new_scene->get_scene_file_path().is_empty()) {
|
||||
edited_scene.write[p_idx].path = new_scene->get_scene_file_path();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue