mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 14:35:58 +02:00
Gtk3: fixed memleak with TGtk3Listbox list.
This commit is contained in:
parent
9eb9286e45
commit
a11eaff2fc
@ -542,6 +542,7 @@ type
|
||||
procedure SetListBoxStyle(AValue: TListBoxStyle);
|
||||
procedure SetMultiSelect(AValue: Boolean);
|
||||
protected
|
||||
procedure DestroyWidget; override;
|
||||
function CreateWidget(const {%H-}Params: TCreateParams):PGtkWidget; override;
|
||||
function EatArrowKeys(const {%H-}AKey: Word): Boolean; override;
|
||||
public
|
||||
@ -5597,6 +5598,20 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TGtk3ListBox.DestroyWidget;
|
||||
var
|
||||
aData: TGtkListStoreStringList;
|
||||
begin
|
||||
if FCentralWidget <> nil then
|
||||
begin
|
||||
aData := TGtkListStoreStringList(g_object_get_data(PGObject(FCentralWidget),GtkListItemLCLListTag));
|
||||
if aData <> nil then
|
||||
aData.Free;
|
||||
g_object_set_data(PGObject(FCentralWidget),GtkListItemLCLListTag, nil);
|
||||
end;
|
||||
inherited DestroyWidget;
|
||||
end;
|
||||
|
||||
function TGtk3ListBox.GetSelCount: Integer;
|
||||
var
|
||||
Selection: PGtkTreeSelection;
|
||||
|
Loading…
Reference in New Issue
Block a user