-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
observe on WorldEntityMut may cause the reference to be invalidated #16212
Copy link
Copy link
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Milestone
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Bevy version
0.15.0-rc.2 (present in 0.14.0) as well
What you did
Result
What went wrong
WorldEntityMutdepends on the fact that theEntityLocationit caches does not change while it is alive, or changes when it itself expects it to.WorldEntityMutlives, as this might cause queued despawns to be run.observeinternally callsworld.spawn().world.spawn()implicitly has aflush()in it, as evidenced in bug reportCommandsapply at unexpected times with exclusiveWorldaccess #14621.WorldEntityMutexists, which means any accesses will use outdatedEntityLocationAdditional information
Also related as context #16034.