You've already forked lazarus-ccr
spktoolbar: Fix "bitmap handle leak" (issue discussed in https://sourceforge.net/p/lazarus-ccr/bugs/35/)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6037 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1918,6 +1918,17 @@ if UseOrgClipRgn then
|
|||||||
|
|
||||||
SelectClipRgn(ACanvas.Handle, ClipRgn);
|
SelectClipRgn(ACanvas.Handle, ClipRgn);
|
||||||
|
|
||||||
|
{ wp: Next part fixes issue https://sourceforge.net/p/lazarus-ccr/bugs/35/ }
|
||||||
|
ImageBitmap := TBitmap.Create;
|
||||||
|
ImageList.GetBitmap(ImageIndex, ImageBitmap);
|
||||||
|
ACanvas.Draw(Point.x, Point.y, ImageBitmap);
|
||||||
|
ImageBitmap.Free;
|
||||||
|
|
||||||
|
{ wp: The following lines were removed and replaced by the "ImageBitmap" lines
|
||||||
|
above in order to fix the "handle leak" of
|
||||||
|
https://sourceforge.net/p/lazarus-ccr/bugs/35/
|
||||||
|
Not daring to touch the ImageList.Draw which would have worked as well. }
|
||||||
|
{
|
||||||
// avoid exclusive draw. draw with local canvas itself.
|
// avoid exclusive draw. draw with local canvas itself.
|
||||||
//ImageList.Draw(ACanvas, Point.x, Point.y, ImageIndex);
|
//ImageList.Draw(ACanvas, Point.x, Point.y, ImageIndex);
|
||||||
{$IfDef LCLWin32}
|
{$IfDef LCLWin32}
|
||||||
@ -1931,7 +1942,7 @@ ImageList.GetBitmap(ImageIndex, ImageBitmap);
|
|||||||
ACanvas.Draw(Point.x, Point.y, ImageBitmap);
|
ACanvas.Draw(Point.x, Point.y, ImageBitmap);
|
||||||
ImageBitmap.Free;
|
ImageBitmap.Free;
|
||||||
{$EndIf}
|
{$EndIf}
|
||||||
|
}
|
||||||
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
DeleteObject(ClipRgn);
|
DeleteObject(ClipRgn);
|
||||||
end;
|
end;
|
||||||
|
@ -13,6 +13,7 @@ uses
|
|||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Application.Scaled := True;
|
||||||
{$IF lcl_fullversion >= 1080000}
|
{$IF lcl_fullversion >= 1080000}
|
||||||
Application.Scaled := True;
|
Application.Scaled := True;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
Reference in New Issue
Block a user