Skip to content

Commit f797072

Browse files
committed
Fix UB in relationship spawns
1 parent 86d0d12 commit f797072

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/bevy_ecs/src/spawn.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ impl<R: Relationship, B: Bundle> DynamicBundle for SpawnOneRelated<R, B> {
331331
) {
332332
let mut target = <R::RelationshipTarget as RelationshipTarget>::with_capacity(1);
333333
<R::RelationshipTarget as DynamicBundle>::get_components(&mut target, func);
334+
core::mem::forget(target);
334335
}
335336

336337
unsafe fn apply_effect(ptr: *mut Self, entity: &mut EntityWorldMut) {

0 commit comments

Comments
 (0)