Skip to content

Conversation

@sandboxcoder
Copy link

@sandboxcoder sandboxcoder commented Sep 24, 2025

Making a correction to my previous commit c404f38 which actually breaks SLD because it can block main queue. Reworking this code to avoid calling CefRunMessageLoop on main loop because that will block main.

  • revert change to BrowserManagerThread (APPLE does not need to spin up this thread, CEF runs on main loop)
  • Update ExecuteTask() and ExecuteSyncTask() so these functions can be invoked from main thread if desired w/o throwing an exception (w/o this change you'll crash if you run OBS.app directly because this frontend runs everything from main thread)
  • Invoke CefDoMessageLoopWork to handle CEF messages on main thread which is non-blocking

* call CefDoMessageLoopWork instead of CefRunMessageLoop which is a
blocking call
* QoL change for dev: update ExecuteTask/ExecuteSyncTask to check if
invoked on main thread. When debugging slobs, we're on main thread. But when
this code is invoked from SLD, we're running from an async thread. so this
code enables the task to be executed with no thought or care where its been
run from.
@sandboxcoder sandboxcoder marked this pull request as ready for review September 24, 2025 16:56
@sandboxcoder sandboxcoder merged commit 19a0a16 into streamlabs Sep 24, 2025
0 of 2 checks passed
@sandboxcoder sandboxcoder deleted the rno/cef_main_loop branch October 6, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants