Преглед изворни кода

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()) {
 		if (main->IsPreviewProgramMode()) {
 			QMetaObject::invokeMethod(main, "TransitionToScene",
 			QMetaObject::invokeMethod(main, "TransitionToScene",
+					WaitConnection(),
 					Q_ARG(OBSSource, OBSSource(scene)));
 					Q_ARG(OBSSource, OBSSource(scene)));
 		} else {
 		} else {
 			QMetaObject::invokeMethod(main, "SetCurrentScene",
 			QMetaObject::invokeMethod(main, "SetCurrentScene",
+					WaitConnection(),
 					Q_ARG(OBSSource, OBSSource(scene)),
 					Q_ARG(OBSSource, OBSSource(scene)),
 					Q_ARG(bool, false));
 					Q_ARG(bool, false));
 		}
 		}