mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 15:50:20 +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;
|
||||
end;
|
||||
Windows.SendMessage(BitBtnHandle, BCM_SETIMAGELIST, 0, LPARAM(@ButtonImageList));
|
||||
if NewBitmap <> 0 then
|
||||
DeleteObject(NewBitmap);
|
||||
end else
|
||||
begin
|
||||
OldBitmap := HBITMAP(Windows.SendMessage(BitBtnHandle, BM_GETIMAGE, IMAGE_BITMAP, 0));
|
||||
@ -478,6 +476,8 @@ begin
|
||||
DeleteObject(OldBitmap);
|
||||
end;
|
||||
DeleteDC(hdcNewBitmap);
|
||||
if NewBitmap <> 0 then
|
||||
DeleteObject(NewBitmap);
|
||||
ReleaseDC(BitBtnHandle, BitBtnDC);
|
||||
BitBtn.Invalidate;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user