From 6cd79f81053d13c30ac54225fb98fb7ff83a37b7 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 25 Dec 2017 13:44:23 -0800 Subject: [PATCH] UI: Add scene collection cleanup event to frontend API This event is called when all scene data has been unloaded. --- UI/obs-frontend-api/obs-frontend-api.h | 4 +++- UI/window-basic-main.cpp | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UI/obs-frontend-api/obs-frontend-api.h b/UI/obs-frontend-api/obs-frontend-api.h index 2b58e96d6..7802efbf8 100644 --- a/UI/obs-frontend-api/obs-frontend-api.h +++ b/UI/obs-frontend-api/obs-frontend-api.h @@ -40,7 +40,9 @@ enum obs_frontend_event { OBS_FRONTEND_EVENT_STUDIO_MODE_ENABLED, OBS_FRONTEND_EVENT_STUDIO_MODE_DISABLED, - OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED + OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED, + + OBS_FRONTEND_EVENT_SCENE_COLLECTION_CLEANUP }; /* ------------------------------------------------------------------------- */ diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 5284e17b5..a09b80885 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -3343,6 +3343,9 @@ void OBSBasic::ClearSceneData() obs_enum_sources(cb, nullptr); + if (api) + api->on_event(OBS_FRONTEND_EVENT_SCENE_COLLECTION_CLEANUP); + disableSaving--; blog(LOG_INFO, "All scene data cleared");