-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Window despawns before PostUpdate #11874
Copy link
Copy link
Open
Labels
A-WindowingPlatform-agnostic interface layer to run your app inPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorC-Code-QualityA section of code that is hard to understand or changeA section of code that is hard to understand or changeD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!
Description
Bevy version
main (1d5388e)
What you did
Create a system that queries for Window in the PostUpdate schedule.
What went wrong
This line right here in WindowPlugin:
bevy/crates/bevy_window/src/lib.rs
Line 126 in 1d5388e
| app.add_systems(Update, close_when_requested); |
The system that despawns the window entity runs during the Update schedule, this means there could be a situation where the window entity does not exist during the PostUpdate schedule. This happened to me and it caused a panic.
Additional information
This could be solved by putting the close_when_requested system in the Last or PostUpdate schedules instead. I don't know which is better though.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-WindowingPlatform-agnostic interface layer to run your app inPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorC-Code-QualityA section of code that is hard to understand or changeA section of code that is hard to understand or changeD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!