Explorar o código

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

(cherry picked from commit 61bc7d65768ebe4baa9b2f888d656cce5109dd5b)
Haoyu Qiu %!s(int64=3) %!d(string=hai) anos
pai
achega
b200a011d1
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      editor/editor_data.cpp

+ 1 - 0
editor/editor_data.cpp

@@ -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) {