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

AppExit doesn't close the app if called on startup #13743

Closed
jabuwu opened this issue Jun 8, 2024 · 3 comments · Fixed by #13744
Closed

AppExit doesn't close the app if called on startup #13743

jabuwu opened this issue Jun 8, 2024 · 3 comments · Fixed by #13744
Labels
A-App Bevy apps and plugins A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior
Milestone

Comments

@jabuwu
Copy link
Contributor

jabuwu commented Jun 8, 2024

Bevy version

Present in 0.14.0-rc.2 and main (651f3d0)

Relevant system information

Only tried on MacOS, not sure about other platforms.

What you did

use bevy::{app::AppExit, prelude::*};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Startup, startup)
        .run();
}

fn startup(mut app_exit: EventWriter<AppExit>) {
    app_exit.send(AppExit::Success);
}

What went wrong

The app hangs, unresponsive, and never closes.

Additional information

This also happens if in an Update system that runs on the first frame.

It was working correctly up until 13151. After this PR, the window still closes but with some error logs.

13236 fixed the error logs, but introduced this particular issue.

This use case probably seems crazy but I do rely on it for some example code.

@jabuwu jabuwu added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jun 8, 2024
@alice-i-cecile
Copy link
Member

alice-i-cecile commented Jun 8, 2024

FYI @Brezak and @tychedelia

@alice-i-cecile alice-i-cecile added A-Windowing Platform-agnostic interface layer to run your app in A-App Bevy apps and plugins and removed S-Needs-Triage This issue needs to be labelled labels Jun 8, 2024
@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Jun 8, 2024
tychedelia added a commit to tychedelia/bevy that referenced this issue Jun 8, 2024
@tychedelia
Copy link
Contributor

@jabuwu will you test #13744 to ensure it works for your more complicated example?

@jabuwu
Copy link
Contributor Author

jabuwu commented Jun 8, 2024

@jabuwu will you test #13744 to ensure it works for your more complicated example?

Works great! 😁 Thank you

github-merge-queue bot pushed a commit that referenced this issue Jun 8, 2024
Fixes #13743.

---------

Co-authored-by: Brezak <bezak.adam@proton.me>
mockersf pushed a commit that referenced this issue Jun 8, 2024
Fixes #13743.

---------

Co-authored-by: Brezak <bezak.adam@proton.me>
mockersf pushed a commit that referenced this issue Jun 8, 2024
Fixes #13743.

---------

Co-authored-by: Brezak <bezak.adam@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-App Bevy apps and plugins A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants