Skip to content

Commit 3abfcad

Browse files
authored
Patch memory leak in Archetype::grow(). (#569)
1 parent f7c8882 commit 3abfcad

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/bevy_ecs/hecs/src/archetype.rs

+7
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,13 @@ impl Archetype {
304304
new_data.as_ptr().add(new_off),
305305
ty.layout.size() * old_count,
306306
);
307+
dealloc(
308+
(*self.data.get()).as_ptr().cast(),
309+
Layout::from_size_align_unchecked(
310+
old_data_size,
311+
self.types.first().map_or(1, |x| x.layout.align()),
312+
),
313+
);
307314
}
308315
}
309316

0 commit comments

Comments
 (0)