From f7465883ca716cf051022519e2eb30ab140ce626 Mon Sep 17 00:00:00 2001 From: Norihiro Kamae Date: Wed, 7 Jun 2023 18:34:53 +0900 Subject: [PATCH] dock: Close docks earlier Close at OBS_FRONTEND_EVENT_SCRIPTING_SHUTDOWN so that the docks will be closed just after the browser docks are closed. This might reduce the possibility of crash at exit. --- src/scope-dock.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/scope-dock.cpp b/src/scope-dock.cpp index 895f16d..787557b 100644 --- a/src/scope-dock.cpp +++ b/src/scope-dock.cpp @@ -142,7 +142,11 @@ static void save_load_scope_docks(obs_data_t *save_data, bool saving, void *) static void frontend_event(enum obs_frontend_event event, void *) { - if (event == OBS_FRONTEND_EVENT_SCENE_COLLECTION_CLEANUP || event == OBS_FRONTEND_EVENT_EXIT) { + if ( +#if LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(28, 0, 0) + event == OBS_FRONTEND_EVENT_SCRIPTING_SHUTDOWN || +#endif + event == OBS_FRONTEND_EVENT_SCENE_COLLECTION_CLEANUP || event == OBS_FRONTEND_EVENT_EXIT) { close_all_docks(); } }