Commit 042ab482 authored by Željan Rikalo's avatar Željan Rikalo 🏊🏼
Browse files

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

git-svn-id: trunk@59892 -
parent 6a64348c
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment