From 8f70a5cc983587de9a71f3fab750b0cd83a8f233 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 14:51:14 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Release=20large=20scale=20operat?= =?UTF-8?q?ion=20state=20on=20failure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bitmask arrays, operations, and pending radar packets were only released at the end of the straight-line handler, so any exception leaked tens of megabytes per malformed request. --- Server/ULandscape.pas | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Server/ULandscape.pas b/Server/ULandscape.pas index 9c920c2..815d65b 100644 --- a/Server/ULandscape.pas +++ b/Server/ULandscape.pas @@ -962,6 +962,7 @@ begin CEDServerInstance.SendPacket(nil, TServerStatePacket.Create(ssOther, Format('%s is performing large scale operations ...', [ANetState.Account.Name]))); + try //Bitmask emptyBits := TBits.Create(64); SetLength(bitMask, FWidth * FHeight); @@ -1146,17 +1147,20 @@ begin end; //clean up + finally for i := Low(bitMask) to High(bitMask) do - bitMask[i].Free; + bitMask[i].Free; emptyBits.Free; additionalAffectedBlocks.Free; - + for i := 0 to operations.Count - 1 do - TLargeScaleOperation(operations.Items[i]).Free; + TLargeScaleOperation(operations.Items[i]).Free; operations.Free; - - //Update clients + FRadarMap.EndUpdate; + end; + + //Update clients for i := Low(clients) to High(clients) do begin if Length(clients[i].Blocks) > 0 then