Browse Source

Merge pull request #62763 from timothyqiu/nullify

Fix heap-use-after-free when closing a scene with its builtin script open
Rémi Verschelde 3 years ago
parent
commit
8dfdb71f8e
1 changed files with 1 additions and 0 deletions
  1. 1 0
      editor/editor_data.cpp

+ 1 - 0
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) {