🐛 Stop map block clones from leaking their cells
Clone overwrote the freshly created cell array without freeing it, leaking 64 cells per clone, and dropped the block header.
This commit is contained in:
@@ -199,8 +199,12 @@ begin
|
||||
Result := TMapBlock.Create(nil);
|
||||
Result.FX := FX;
|
||||
Result.FY := FY;
|
||||
Result.FHeader := FHeader;
|
||||
for i := 0 to 63 do
|
||||
begin
|
||||
Result.Cells[i].Free;
|
||||
Result.Cells[i] := Cells[i].Clone;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMapBlock.Write(AData: TStream);
|
||||
|
||||
Reference in New Issue
Block a user