Patch memory leak in Archetype::grow(). (#569)

This commit is contained in:
Alexander Sepity 2020-09-25 22:33:27 +03:00 committed by GitHub
parent f7c8882c04
commit 3abfcad7ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()),
),
);
}
}