Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait on shutdown for docks to close on Linux (Event-based solution) #460

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

WizardCM
Copy link
Member

@WizardCM WizardCM commented Oct 18, 2024

Description

Solution 1 was a no-go with the Qt event loop, which we'd prefer to use.

This is solution two, which listens for an event from CEF when the shutdown is occurring. At most, it's configured to wait 1 second per dock (this is usually more than enough time, but we could bump it to 2 or 3 if needed).

This also moves widget destruction to after Qt destruction, otherwise CEF can't notify Qt that it's ready to close.

Also Closes #459

Motivation and Context

The original solution in #450 works fine when not using the Qt event loop, however any method of waiting with the Qt event loop causes all CEF events to go on hold too, resulting in a hang or crash.

How Has This Been Tested?

On Linux, with two browser docks: YouTube and Google. The former is considered a "heavier" dock and takes longer to close.

Also successfully loaded the Twitch OAuth window.

Tested with our current Beta 1-shipping CEF build of 127.

With this PR, there is no crash or hang on shutdown.

Note: Have not tested "What's New" myself.

Types of changes

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

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.
  • I have included updates to all appropriate documentation.

The original solution works fine when not using the Qt event loop,
however any method of waiting with the Qt event loop causes all
CEF events to go on hold too, resulting in a hang or crash.

Instead, wait for CEF to announce it's ready, then delete the widget.
@WizardCM WizardCM added the Bug Fix Non-breaking change which fixes an issue label Oct 18, 2024
@tytan652
Copy link
Contributor

Tested on my machine, all the freezes issues are fixed.

Copy link
Member

@RytoEX RytoEX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine on Windows.

@RytoEX RytoEX merged commit 910617b into obsproject:master Oct 18, 2024
1 check passed
@WizardCM WizardCM deleted the 127-shutdown-fix-event branch October 19, 2024 00:53
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants