From c0121312ed155eb9fc486121313519c5264da52d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sat, 14 Nov 2026 22:54:25 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Stop=20map=20block=20clones=20fr?= =?UTF-8?q?om=20leaking=20their=20cells?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clone overwrote the freshly created cell array without freeing it, leaking 64 cells per clone, and dropped the block header. --- UOLib/UMap.pas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UOLib/UMap.pas b/UOLib/UMap.pas index 40d88a5..9f5a990 100644 --- a/UOLib/UMap.pas +++ b/UOLib/UMap.pas @@ -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);