mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 13:49:54 +00:00
Unassign scene root before freeing
This commit is contained in:
parent
7a207b3eaa
commit
7573388c82
1 changed files with 3 additions and 0 deletions
|
|
@ -643,6 +643,9 @@ void EditorData::remove_scene(int p_idx) {
|
||||||
editor_plugins[i]->notify_scene_closed(edited_scene[p_idx].root->get_scene_file_path());
|
editor_plugins[i]->notify_scene_closed(edited_scene[p_idx].root->get_scene_file_path());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (edited_scene[p_idx].root == SceneTree::get_singleton()->get_edited_scene_root()) {
|
||||||
|
SceneTree::get_singleton()->set_edited_scene_root(nullptr);
|
||||||
|
}
|
||||||
memdelete(edited_scene[p_idx].root);
|
memdelete(edited_scene[p_idx].root);
|
||||||
edited_scene.write[p_idx].root = nullptr;
|
edited_scene.write[p_idx].root = nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue