From e265fc92ed488804b3ff5f8558af4f76c08f8a2e Mon Sep 17 00:00:00 2001 From: Ilya Melamed Date: Fri, 4 May 2018 15:43:03 -0700 Subject: [PATCH] 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 --- UI/api-interface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UI/api-interface.cpp b/UI/api-interface.cpp index b72f1cdab..e7cc8365c 100644 --- a/UI/api-interface.cpp +++ b/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)); }