Prevent an additional world update after all windows have closed on Windows#18175
Conversation
…indows The fix in bevyengine#18105 includes a check for running headless, but this allows for an extra world update during shutdown. This commit checks if the AppExit event has been recorded and prevents the additional world update.
fa155ad to
58982ad
Compare
greeble-dev
left a comment
There was a problem hiding this comment.
Tested on Win10/Nvidia. Tried the mentioned examples and a few others.
Side note: Is there a reason the monitor_info example is set to not close when all windows are closed? I assumed this was a bug at first. I tried removing the ExitCondition::DontExit and it worked fine, but I don't have multiple monitors.
That confused me on a previous PR. I also thought it was a bug at first. I think there needs to be an example that exercises that behavior, but I'm not sure that |
Objective
The fix in #18105 includes a check for running headless, but that allows for an extra world update during shutdown.
This commit checks if the
AppExitevent has been recorded and prevents the additional world update.Before
After
Testing
Ran
windowexamplesmonitor_infocontinues to run after all windows are closed (it hasExitCondition::DontExit)window_settingsinvisible window creation works as expectedmultiple_windowsexits after both windows are closed with a single exit message