Window despawns before PostUpdate
#11874
Labels
A-Windowing
Platform-agnostic interface layer to run your app in
C-Bug
An unexpected or incorrect behavior
C-Code-Quality
A section of code that is hard to understand or change
D-Complex
Quite challenging from either a design or technical perspective. Ask for help!
Bevy version
main (1d5388e)
What you did
Create a system that queries for
Window
in thePostUpdate
schedule.What went wrong
This line right here in
WindowPlugin
:bevy/crates/bevy_window/src/lib.rs
Line 126 in 1d5388e
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 thePostUpdate
schedule. This happened to me and it caused a panic.Additional information
This could be solved by putting the
close_when_requested
system in theLast
orPostUpdate
schedules instead. I don't know which is better though.The text was updated successfully, but these errors were encountered: