mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-12 19:40:35 +01:00
LCL: TCustomImageList fix for memory leak. Patch by Ondrej Pokorny. issue #34708
git-svn-id: trunk@59892 -
This commit is contained in:
parent
6a64348cd5
commit
042ab4826a
@ -326,9 +326,9 @@ begin
|
|||||||
if n <> 0
|
if n <> 0
|
||||||
then Inc(ACount, FImageList.FAllocBy - n);
|
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;
|
end;
|
||||||
|
|
||||||
procedure TCustomImageListResolution.CheckIndex(AIndex: Integer;
|
procedure TCustomImageListResolution.CheckIndex(AIndex: Integer;
|
||||||
@ -1461,7 +1461,7 @@ begin
|
|||||||
ToR.AllocData(ToR.FCount);
|
ToR.AllocData(ToR.FCount);
|
||||||
if ToR.FCount>0 then
|
if ToR.FCount>0 then
|
||||||
begin
|
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);
|
System.Move(FromR.FData[0], ToR.FData[0], ToR.FCount * DataSize);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user