소스 검색

Fixes editor crash on closing

Fixes editor crash when the gizmo is destroyed and the `SceneTree` is already freed.
AndreaCatania 4 년 전
부모
커밋
79f55fcded
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      editor/plugins/node_3d_editor_plugin.cpp

+ 6 - 1
editor/plugins/node_3d_editor_plugin.cpp

@@ -4503,7 +4503,12 @@ void _update_all_gizmos(Node *p_node) {
 
 void Node3DEditor::update_all_gizmos(Node *p_node) {
 	if (!p_node) {
-		p_node = SceneTree::get_singleton()->get_root();
+		if (SceneTree::get_singleton()) {
+			p_node = SceneTree::get_singleton()->get_root();
+		} else {
+			// No scene tree, so nothing to update.
+			return;
+		}
 	}
 	_update_all_gizmos(p_node);
 }