Просмотр исходного кода

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

Haoyu Qiu 3 лет назад
Родитель
Сommit
61bc7d6576
1 измененных файлов с 1 добавлено и 0 удалено
  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) {