Fix freeze when changing scene collection

This commit is contained in:
WarmUpTill
2022-11-16 14:49:13 +01:00
committed by WarmUpTill
parent 9bcced524b
commit 624ff9f5c6
3 changed files with 19 additions and 1 deletions

View File

@@ -601,6 +601,17 @@ void handleExit()
FreeSceneSwitcher();
}
void handleSceneCollectionChanging()
{
if (switcher->settingsWindowOpened) {
AdvSceneSwitcher::window->close();
}
if (!switcher->stop) {
switcher->sceneColletionStop = true;
switcher->Stop();
}
}
// Note to future self:
// be careful using switcher->m here as there is potential for deadlocks when using
// frontend functions such as obs_frontend_set_current_scene()
@@ -646,6 +657,11 @@ static void OBSEvent(enum obs_frontend_event event, void *switcher)
case OBS_FRONTEND_EVENT_STREAMING_STOPPING:
setStreamStopping();
break;
#if LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(27, 2, 0)
case OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGING:
handleSceneCollectionChanging();
break;
#endif
default:
break;
}