소스 검색

Avoid possibly showing two Dialogs at the same time

Update editor/scene_tree_editor.cpp

Add a comment to explain why

Co-authored-by: Rémi Verschelde <[email protected]>
Rindbee 3 년 전
부모
커밋
72a768b24f
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      editor/scene_tree_editor.cpp

+ 2 - 1
editor/scene_tree_editor.cpp

@@ -1353,8 +1353,9 @@ void SceneTreeDialog::_cancel() {
 
 void SceneTreeDialog::_select() {
 	if (tree->get_selected()) {
-		emit_signal(SNAME("selected"), tree->get_selected()->get_path());
+		// The signal may cause another dialog to be displayed, so be sure to hide this one first.
 		hide();
+		emit_signal(SNAME("selected"), tree->get_selected()->get_path());
 	}
 }