Do not try to create the browser before init#519
Open
hoshinolina wants to merge 1 commit into
Open
Conversation
notr1ch
approved these changes
Apr 15, 2026
Member
|
What's the actual root cause of the race? At first glance the "browser manager thread" seems like a culprit, because it decouples the actual initialisation of CEF from the main thread on Windows and Linux (but not on macOS), so CEF will only be initialised "eventually". On macOS |
Contributor
Author
|
Yes, it's that. In particular, the graphics thread will call tick on the source once it's added to the scene, and if CEF init isn't complete yet by then bad things happen.
|
PatTheMav
reviewed
Apr 27, 2026
Member
PatTheMav
left a comment
There was a problem hiding this comment.
Annoying that it's necessary, but seems like the most elegant fix for this race condition.
Please amend the commit description per our contribution guidelines to explain the "why" of the fix (explaining the race condition, it's root cause, and why this fixes it).
CEF is initialized in a browser manager thread on Windows and Linux, which happens asynchronously. The graphics tick function may be called before CEF initialization completes, which leads to asserts and other issues. Ensure this does not happen by checking for CEF init completion.
8bea62a to
ec4be1a
Compare
Contributor
Author
|
Done. |
PatTheMav
reviewed
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Should fix the random asserts on startup (not related to the recent consistent startup failures), I think.
Motivation and Context
Fixes a race.
How Has This Been Tested?
Quick smoke test.
Types of changes
Checklist: