From 02c350056f11c915fa9fd86df752e68ea96aaf0e Mon Sep 17 00:00:00 2001 From: Richard Osborne Date: Mon, 15 Sep 2025 12:01:17 -0500 Subject: [PATCH] run cef initialize & message loop on main thread * fix crash in obs31 branch (once this is merged in) * resolves warning in obs-30 branch * invoke CefInit, Cef message loop, etc on Main thread as indicated by Cef docs --- obs-browser-plugin.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/obs-browser-plugin.cpp b/obs-browser-plugin.cpp index d9b4a9e73..4b198e4f4 100644 --- a/obs-browser-plugin.cpp +++ b/obs-browser-plugin.cpp @@ -507,9 +507,15 @@ static void BrowserShutdown(void) #ifndef ENABLE_BROWSER_QT_LOOP static void BrowserManagerThread(obs_data_t *settings) { - BrowserInit(settings); - CefRunMessageLoop(); - BrowserShutdown(); +#ifdef __APPLE__ + ExecuteSyncTask([&settings]() { +#endif + BrowserInit(settings); + CefRunMessageLoop(); + BrowserShutdown(); +#ifdef __APPLE__ + }); +#endif } #endif