소스 검색

UI: Block when calling obs_frontend_set_current_scene

Uses WaitConnection() when calling obs_frontend_set_current_scene to
ensure that the calling thread and the UI thread are synchronized when
setting the current scene via this function.

Closes obsproject/obs-studio#1234
Ilya Melamed 7 년 전
부모
커밋
e265fc92ed
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      UI/api-interface.cpp

+ 2 - 0
UI/api-interface.cpp

@@ -93,9 +93,11 @@ struct OBSStudioAPI : obs_frontend_callbacks {
 	{
 		if (main->IsPreviewProgramMode()) {
 			QMetaObject::invokeMethod(main, "TransitionToScene",
+					WaitConnection(),
 					Q_ARG(OBSSource, OBSSource(scene)));
 		} else {
 			QMetaObject::invokeMethod(main, "SetCurrentScene",
+					WaitConnection(),
 					Q_ARG(OBSSource, OBSSource(scene)),
 					Q_ARG(bool, false));
 		}