ecs: fix memory leak in ArchetypeStorage

This commit is contained in:
dweiller 2022-07-01 02:24:50 +10:00 committed by Stephen Gutekanst
parent 2d923ea9b7
commit f406f42005

View file

@ -166,6 +166,9 @@ pub const ArchetypeStorage = struct {
offset += new_capacity * column.size;
}
if (storage.capacity > 0) {
gpa.free(storage.block);
}
storage.block = new_block;
storage.capacity = @intCast(u32, new_capacity);
}