Skip to content

frontend: Queue navigation in auth window to fix crash - #14072

Merged
RytoEX merged 1 commit into
obsproject:masterfrom
WizardCM:fix-service-login-crash
Oct 27, 2026
Merged

RytoEX merged 1 commit into
obsproject:masterfrom
WizardCM:fix-service-login-crash

Conversation

@WizardCM

Copy link
Copy Markdown
Member

Description

Queue navigation of service integration login window.

Motivation and Context

Qt and CEF like to fight each other's queues.

Fixes a crash when attempting to log into Twitch Service Integration.

Fix found by @prgmitchell and verified by both Mitchell and myself.

How Has This Been Tested?

Log into Twitch on macOS.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@WizardCM WizardCM added kind/bug Categorizes issue or PR as related to a bug. platform/macos Categorizes issue or PR as affecting macOS specifically labels Oct 24, 2026
@PatTheMav

Copy link
Copy Markdown
Member

Would be great if the commit message would also go into detail what the issue is and why this fixes it.

Feel free to copy this:

When the browser panel inside the OAuth dialog navigates to a new URL, it calls the navigation URL handler from its own event loop. The OAuth dialog has installed such a handler to check each navigation event's URL for a possible "code" argument.

If such a "code" argument is found, the dialog's "accept" method is called, which in turn will call "closeBrowser" as the dialog attempts to close itself.

This results in browser shutdown code running in the middle of CEF draining its main event loop of pending tasks.

After the switch to the Chromium runtime this now results in a crash within CEF's "InterceptNavigationThrottle" destructor, which is executed as part of the browser shutdown.

Decoupling the URL change handler of the dialog from the URL change handler of the browser panel ensures that the browser shutdown is initiated from the Qt main event loop and not the CEF main event loop and resolves the issue.

@PatTheMav

Copy link
Copy Markdown
Member

Probably makes sense to merge the commits as otherwise one carries context (per our contribution guidelines) but the other doesn't. Each change individually is "complete", but I don't see much value in duplicating the same text. 😅

@RytoEX
RytoEX requested a review from Warchamp7 October 27, 2026 19:27
@RytoEX RytoEX added the release-note/fix Groups pull request under the "Fixes" section in the associated patch notes label Oct 27, 2026
@RytoEX RytoEX added this to the OBS Studio 33.0 milestone Oct 27, 2026
When the browser panel inside a dialog navigates to a new URL, it calls
the navigation URL handler from its own event loop. The OAuth dialog has
installed such a handler to check each navigation event's URL for a
possible "code" argument.

If such a "code" argument is found, the dialog's "accept" method is
called, which in turn will call "closeBrowser" as the dialog attempts to
close itself.

This results in browser shutdown code running in the middle of CEF
draining its main event loop of pending tasks.

In the Chrome Runtime this now results in a crash within CEF's
"InterceptNavigationThrottle" destructor, which is executed as part of
the browser shutdown.

Decoupling the URL change handler of the dialog from the URL change
handler of the browser panel ensures that the browser shutdown is
initiated from the Qt main event loop and not the CEF main event loop
and resolves the issue.
@RytoEX
RytoEX force-pushed the fix-service-login-crash branch from 4f87548 to c440daf Compare October 27, 2026 20:01
@RytoEX
RytoEX merged commit 2735cc4 into obsproject:master Oct 27, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from Ready For Review to Merged in Current Release Tracker (33.0) Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. platform/macos Categorizes issue or PR as affecting macOS specifically release-note/fix Groups pull request under the "Fixes" section in the associated patch notes

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

3 participants