mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 19:52:26 +02:00
LCL: Fix a memory leak in TImageList.GetIcon. Issue #35684, patch from BrunoK.
git-svn-id: trunk@61624 -
This commit is contained in:
parent
123e8f9f45
commit
b915700854
@ -565,8 +565,8 @@ begin
|
||||
GetRawImage(Index, RawImg);
|
||||
RawImg.PerformEffect(AEffect, True);
|
||||
|
||||
FillChar(IconInfo, sizeof(TIconInfo), 0);
|
||||
IconInfo.fIcon := True;
|
||||
IconInfo.hbmMask := 0;
|
||||
if not CreateCompatibleBitmaps(RawImg, IconInfo.hbmColor, IconInfo.hbmMask, True)
|
||||
then begin
|
||||
// bummer, the widgetset doesn't support our 32bit format, try device
|
||||
@ -580,6 +580,10 @@ begin
|
||||
ListImg.Free;
|
||||
end;
|
||||
Image.Handle := CreateIconIndirect(@IconInfo);
|
||||
if IconInfo.hbmColor<>0 then
|
||||
DeleteObject(IconInfo.hbmColor);
|
||||
if IconInfo.hbmMask<>0 then
|
||||
DeleteObject(IconInfo.hbmMask);
|
||||
|
||||
RawImg.FreeData;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user