Commit 7bcf1cc5 authored by wp's avatar wp
Browse files

LCL: Fix TCustomListbox not releasing Canvas handle in DestroyWnd (issue #34249).

git-svn-id: trunk@59094 -
parent 080e9177
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment