🐛 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:
2026-11-15 22:06:50 +01:00
parent dab5f85816
commit c0121312ed
+4
View File
@@ -199,9 +199,13 @@ 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);
var