mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
Patch memory leak in Archetype::grow()
. (#569)
This commit is contained in:
parent
f7c8882c04
commit
3abfcad7ab
1 changed files with 7 additions and 0 deletions
|
@ -304,6 +304,13 @@ impl Archetype {
|
|||
new_data.as_ptr().add(new_off),
|
||||
ty.layout.size() * old_count,
|
||||
);
|
||||
dealloc(
|
||||
(*self.data.get()).as_ptr().cast(),
|
||||
Layout::from_size_align_unchecked(
|
||||
old_data_size,
|
||||
self.types.first().map_or(1, |x| x.layout.align()),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue