Fix heap-use-after-free when closing a scene with its builtin script open

(cherry picked from commit 61bc7d6576)
This commit is contained in:
Haoyu Qiu 2022-07-06 10:43:55 +08:00 committed by Rémi Verschelde
parent 7a35bf683a
commit b200a011d1
1 changed files with 1 additions and 0 deletions

View File

@ -535,6 +535,7 @@ void EditorData::remove_scene(int p_idx) {
}
memdelete(edited_scene[p_idx].root);
edited_scene.write[p_idx].root = nullptr;
}
if (current_edited_scene > p_idx) {