Skip to content

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

@jabuwu

Description

@jabuwu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AppBevy apps and pluginsA-WindowingPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions