Skip to content

Conversation

zavitax
Copy link
Contributor

@zavitax zavitax commented Oct 27, 2019

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.

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.
@WizardCM WizardCM added Bug Fix Non-breaking change which fixes an issue Code Cleanup Non-breaking change which makes code smaller or more readable labels Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue Code Cleanup Non-breaking change which makes code smaller or more readable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants