Remove ExecuteOnBrowser wrapper on destroy #181

Closed
zavitax wants to merge 1 commit from destroy_browser into master
zavitax commented 2019-10-27 04:44:51 -05:00 (Migrated from github.com)

Description

Remove ExecuteOnBrowser() wrapper from BrowserSource::DestroyBrowser().

Motivation and Context

Under certain conditions, when browser source scene items are removed
in a loop, CEF UI thread may hang waiting for previous invocations of
ExecuteOnBrowser() to complete resulting in a deadlock.

Since CefBrowserHost::WasHidden() and CefBrowserHost::CloseBrowser()
are not required to be called on a certain thread, removing
ExecuteOnBrowser() altogether preserves the functionality, eliminates
the deadlock and simplifies the code.

How Has This Been Tested?

  • Remove single browser source
  • Remove multiple browser sources
  • Change scene collection
  • Hide/showbrowser source with "Shutdown when hidden" checked
  • Exit program

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Code cleanup (non-breaking change which makes code smaller or more readable)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
### Description Remove `ExecuteOnBrowser()` wrapper from `BrowserSource::DestroyBrowser()`. ### Motivation and Context Under certain conditions, when browser source scene items are removed in a loop, CEF UI thread may hang waiting for previous invocations of ExecuteOnBrowser() to complete resulting in a deadlock. Since CefBrowserHost::WasHidden() and CefBrowserHost::CloseBrowser() are not required to be called on a certain thread, removing ExecuteOnBrowser() altogether preserves the functionality, eliminates the deadlock and simplifies the code. ### How Has This Been Tested? - Remove single browser source - Remove multiple browser sources - Change scene collection - Hide/showbrowser source with "Shutdown when hidden" checked - Exit program ### Types of changes - Bug fix (non-breaking change which fixes an issue) - Code cleanup (non-breaking change which makes code smaller or more readable) ### Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] My code has been run through [clang-format](https://github.com/obsproject/obs-studio/blob/master/.clang-format). - [x] I have read the [**contributing** document](https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst). - [x] My code is not on the master branch. - [x] The code has been tested. - [x] All commit messages are properly formatted and commits squashed where appropriate.
PatTheMav commented 2025-11-07 08:46:03 -06:00 (Migrated from github.com)

@WizardCM Can probably be closed with #506 merged.

@WizardCM Can probably be closed with #506 merged.
RytoEX commented 2025-11-07 15:56:37 -06:00 (Migrated from github.com)

Closing per above.

Closing per above.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-obsproject/obs-browser!181
No description provided.