-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fix window close in example cause panic #17533
base: main
Are you sure you want to change the base?
Conversation
While your PR fixes the issue from the point of view of the example, I feel like there's something wrong regarding how Bevy handles this that should probably be fixed. In order, during a
I feel like step 1 should be done between 2 and 3, to avoid having a frame where the Window entity is despawned despite Bevy being configured to exit when that happens. So I expect the same panic occuring in other examples using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently the order in which Bevy does things is to allow people to write a system to react to an AppExit event in Update. I'm not sure this is right, but as long as it stays that way and Single panics, systems should probably never expect that there will always be a Window, and so the Single<&Window>
should be reverted back. So, approving this PR. Might be needed for other examples too.
I think this is the same issue I reported here: #16066 |
This doesn't seem right to me. The problem at hand is a general one. We shouldn't have to validate parameters like this. |
@Selene-Amanita @BenjaminBrienen I have fix this problem in #17543 |
Closing in favor of the other PR |
|
I just have changed |
Objective
Fixes #17532
Solution