summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2022-07-06 10:43:55 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2022-07-06 10:45:36 +0800
commit61bc7d65768ebe4baa9b2f888d656cce5109dd5b (patch)
tree759d47cab246c227ab0809e3e80bf1b1c78909ca
parent1b057e18f24694cd2ece6f81ed079d6a63d33ae6 (diff)
Fix heap-use-after-free when closing a scene with its builtin script open
-rw-r--r--editor/editor_data.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 64c234a07c..e9e3320a3d 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -534,6 +534,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) {