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

Window despawns before PostUpdate #11874

Open
doonv opened this issue Feb 15, 2024 · 3 comments
Open

Window despawns before PostUpdate #11874

doonv opened this issue Feb 15, 2024 · 3 comments
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!

Comments

@doonv
Copy link
Contributor

doonv commented Feb 15, 2024

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:

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.

@doonv doonv added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Feb 15, 2024
@rparrett
Copy link
Contributor

Possibly related: #7403

@doonv
Copy link
Contributor Author

doonv commented Feb 15, 2024

I've been messing around with window-related system schedules and I can't seem to fix the bug.

There's a lot of systems that require another system to do something which then triggers the system to do something, and that system requires another system, etc... It's confusing.

@alice-i-cecile alice-i-cecile added A-Windowing Platform-agnostic interface layer to run your app in 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! and removed S-Needs-Triage This issue needs to be labelled labels Feb 16, 2024
@bevyengine bevyengine deleted a comment from duarteoficialhp Feb 17, 2024
@doonv
Copy link
Contributor Author

doonv commented Apr 4, 2024

This is still an issue as of b27896f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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!
Projects
None yet
Development

No branches or pull requests

3 participants