mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 21:40:25 +02:00
lcl: fix memory leak in the CopyMask procedure (bug #0013430)
git-svn-id: trunk@19175 -
This commit is contained in:
parent
15bcc80f78
commit
bba625c7a6
@ -23,6 +23,7 @@ procedure TRasterImage.Assign(Source: TPersistent);
|
||||
var
|
||||
RI: TRawImage;
|
||||
msk, dummy: HBITMAP;
|
||||
Res: Boolean;
|
||||
begin
|
||||
// we need a winapi.CopyImage here (would make things easier)
|
||||
// in theory, it should not matter if a HBITMAP was created as bitmap or as mask
|
||||
@ -36,8 +37,9 @@ procedure TRasterImage.Assign(Source: TPersistent);
|
||||
DeleteObject(dummy);
|
||||
|
||||
if BitmapHandleAllocated
|
||||
then UpdateHandles(BitmapHandle, msk)
|
||||
else UpdateHandles(0, msk);
|
||||
then Res := UpdateHandles(BitmapHandle, msk)
|
||||
else Res := UpdateHandles(0, msk);
|
||||
if not Res then DeleteObject(msk);
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user