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

Ensure clean exit #13236

Merged
merged 2 commits into from
May 12, 2024
Merged

Ensure clean exit #13236

merged 2 commits into from
May 12, 2024

Commits on May 4, 2024

  1. Ensure clean exit

    Fixes two issues related to bevyengine#13208.
    
    First, we ensure render resources for a window are always dropped first
    to ensure that the `winit::Window` always drops on the main thread when
    it is removed from `WinitWindows`. Previously, changes in bevyengine#12978 caused
    the window to drop in the render world, causing issues.
    
    We accomplish this by delaying despawning the window by a frame by
    inserting a marker component `ClosingWindow` that indicates the window
    has been requested to close and is in the process of closing. The
    render world now responds to the equivalent `WindowClosing` event
    rather than `WindowCloseed` which now fires after the render resources
    are guarunteed to be cleaned up.
    
    Secondly, fixing the above caused (revealed?) that additional events
    were being delivered to the the event loop handler after exit had
    already been requested: in my testing `RedrawRequested` and
    `LoopExiting`. This caused errors to be reported try to send an
    exit event on the close channel. There are two options here:
        - Guard the handler so no additional events are delivered once the
        app is exiting. I considered this but worried it might be
        confusing or bug prone if in the future someone wants to handle
       `LoopExiting` or some other event to clean-up while exiting.
        - Only send an exit signal if we are not already exiting. It
        doesn't appear to cause any problems to handle the extra events
        so this seems safer.
    Fixing this also appears to have fixed bevyengine#13231.
    tychedelia committed May 4, 2024
    Configuration menu
    Copy the full SHA
    a8acdb3 View commit details
    Browse the repository at this point in the history

Commits on May 7, 2024

  1. Configuration menu
    Copy the full SHA
    75c33d4 View commit details
    Browse the repository at this point in the history