mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 10:49:16 +02:00
LCL-Win32: BitButton leaks GDI objects. Issue #36678, patch from Anton Kavalenka.
git-svn-id: trunk@62947 -
This commit is contained in:
parent
b58a1edfb6
commit
c6a922e9c2
@ -466,8 +466,6 @@ begin
|
|||||||
ButtonImageList.himl := 0;
|
ButtonImageList.himl := 0;
|
||||||
end;
|
end;
|
||||||
Windows.SendMessage(BitBtnHandle, BCM_SETIMAGELIST, 0, LPARAM(@ButtonImageList));
|
Windows.SendMessage(BitBtnHandle, BCM_SETIMAGELIST, 0, LPARAM(@ButtonImageList));
|
||||||
if NewBitmap <> 0 then
|
|
||||||
DeleteObject(NewBitmap);
|
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
OldBitmap := HBITMAP(Windows.SendMessage(BitBtnHandle, BM_GETIMAGE, IMAGE_BITMAP, 0));
|
OldBitmap := HBITMAP(Windows.SendMessage(BitBtnHandle, BM_GETIMAGE, IMAGE_BITMAP, 0));
|
||||||
@ -478,6 +476,8 @@ begin
|
|||||||
DeleteObject(OldBitmap);
|
DeleteObject(OldBitmap);
|
||||||
end;
|
end;
|
||||||
DeleteDC(hdcNewBitmap);
|
DeleteDC(hdcNewBitmap);
|
||||||
|
if NewBitmap <> 0 then
|
||||||
|
DeleteObject(NewBitmap);
|
||||||
ReleaseDC(BitBtnHandle, BitBtnDC);
|
ReleaseDC(BitBtnHandle, BitBtnDC);
|
||||||
BitBtn.Invalidate;
|
BitBtn.Invalidate;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user