mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 20:50:18 +02:00
LCL: Fix TCustomListbox not releasing Canvas handle in DestroyWnd (issue #34249).
git-svn-id: trunk@59094 -
This commit is contained in:
parent
080e9177b5
commit
7bcf1cc533
@ -128,6 +128,13 @@ begin
|
||||
UnlockSelectionChange;
|
||||
end;
|
||||
|
||||
procedure TCustomListbox.DestroyWnd;
|
||||
begin
|
||||
inherited;
|
||||
if FCanvas <> nil then
|
||||
TControlCanvas(FCanvas).FreeHandle;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
procedure TCustomListBox.FinalizeWnd
|
||||
------------------------------------------------------------------------------}
|
||||
@ -296,9 +303,10 @@ begin
|
||||
begin
|
||||
if Self.ItemHeight <> 0 then
|
||||
AHeight := Self.ItemHeight
|
||||
else
|
||||
else begin
|
||||
Canvas.Font := Font;
|
||||
AHeight := Canvas.TextHeight('Hg');
|
||||
|
||||
end;
|
||||
MeasureItem(Integer(ItemId), AHeight);
|
||||
if AHeight > 0 then
|
||||
ItemHeight := AHeight;
|
||||
|
@ -548,6 +548,7 @@ type
|
||||
function CalculateStandardItemHeight: Integer;
|
||||
procedure CreateParams(var Params: TCreateParams); override;
|
||||
procedure InitializeWnd; override;
|
||||
procedure DestroyWnd; override;
|
||||
procedure FinalizeWnd; override;
|
||||
class function GetControlClassDefaultSize: TSize; override;
|
||||
procedure CheckIndex(const AIndex: Integer);
|
||||
|
Loading…
Reference in New Issue
Block a user