🐛 Release large scale operation state on failure

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.
This commit is contained in:
2026-11-15 22:08:32 +01:00
parent e38a487d56
commit 8f70a5cc98
+5 -1
View File
@@ -962,6 +962,7 @@ begin
CEDServerInstance.SendPacket(nil, TServerStatePacket.Create(ssOther, CEDServerInstance.SendPacket(nil, TServerStatePacket.Create(ssOther,
Format('%s is performing large scale operations ...', [ANetState.Account.Name]))); Format('%s is performing large scale operations ...', [ANetState.Account.Name])));
try
//Bitmask //Bitmask
emptyBits := TBits.Create(64); emptyBits := TBits.Create(64);
SetLength(bitMask, FWidth * FHeight); SetLength(bitMask, FWidth * FHeight);
@@ -1146,6 +1147,7 @@ begin
end; end;
//clean up //clean up
finally
for i := Low(bitMask) to High(bitMask) do for i := Low(bitMask) to High(bitMask) do
bitMask[i].Free; bitMask[i].Free;
emptyBits.Free; emptyBits.Free;
@@ -1155,8 +1157,10 @@ begin
TLargeScaleOperation(operations.Items[i]).Free; TLargeScaleOperation(operations.Items[i]).Free;
operations.Free; operations.Free;
//Update clients
FRadarMap.EndUpdate; FRadarMap.EndUpdate;
end;
//Update clients
for i := Low(clients) to High(clients) do for i := Low(clients) to High(clients) do
begin begin
if Length(clients[i].Blocks) > 0 then if Length(clients[i].Blocks) > 0 then