ecs: fix memory leak in ArchetypeStorage
This commit is contained in:
parent
2d923ea9b7
commit
f406f42005
1 changed files with 3 additions and 0 deletions
|
|
@ -166,6 +166,9 @@ pub const ArchetypeStorage = struct {
|
||||||
offset += new_capacity * column.size;
|
offset += new_capacity * column.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (storage.capacity > 0) {
|
||||||
|
gpa.free(storage.block);
|
||||||
|
}
|
||||||
storage.block = new_block;
|
storage.block = new_block;
|
||||||
storage.capacity = @intCast(u32, new_capacity);
|
storage.capacity = @intCast(u32, new_capacity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue