🚨 Free the block index when a landscape update fails mid-packet
This commit is contained in:
@@ -770,6 +770,7 @@ var
|
||||
block: TBlock;
|
||||
begin
|
||||
index := TGenericIndex.Create(nil);
|
||||
try
|
||||
while ABuffer.Position < ABuffer.Size do
|
||||
begin
|
||||
ABuffer.Read(coords, SizeOf(TBlockCoords));
|
||||
@@ -793,7 +794,9 @@ begin
|
||||
|
||||
if Assigned(FOnNewBlock) then FOnNewBlock(block);
|
||||
end;
|
||||
finally
|
||||
index.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TLandscape.OnDrawMapPacket(ABuffer: TEnhancedMemoryStream);
|
||||
|
||||
Reference in New Issue
Block a user