LCL: TCustomImageList fix for memory leak. Patch by Ondrej Pokorny. issue #34708

git-svn-id: trunk@59892 -
This commit is contained in:
zeljko 2018-12-22 09:43:31 +00:00
parent 6a64348cd5
commit 042ab4826a

View File

@ -326,9 +326,9 @@ begin
if n <> 0
then Inc(ACount, FImageList.FAllocBy - n);
SetLength(FData, ACount * FWidth * FHeight * SizeOf(FData[0]));
SetLength(FData, ACount * FWidth * FHeight);
Inc(FAllocCount, ACount);
FAllocCount := ACount;
end;
procedure TCustomImageListResolution.CheckIndex(AIndex: Integer;
@ -1461,7 +1461,7 @@ begin
ToR.AllocData(ToR.FCount);
if ToR.FCount>0 then
begin
DataSize := ToR.FWidth * ToR.FHeight * SizeOf(FData[0]);
DataSize := ToR.FWidth * ToR.FHeight * SizeOf(ToR.FData[0]);
System.Move(FromR.FData[0], ToR.FData[0], ToR.FCount * DataSize);
end;
end;