mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-05 15:02:12 +02:00
LCL: treeview: trigger OnDeletion() event before node is unbinded.Fixes issue #17832 .
git-svn-id: trunk@28092 -
This commit is contained in:
parent
ab18b9f85b
commit
674800cb1b
@ -276,15 +276,20 @@ begin
|
||||
DebugLn('[TTreeNode.Destroy] Self=',DbgS(Self),' Self.Text=',Text);
|
||||
{$ENDIF}
|
||||
Include(FStates,nsDeleting);
|
||||
|
||||
// we must trigger TCustomTreeView.OnDeletion event before
|
||||
// unbinding.See issue #17832.
|
||||
if (Owner <> nil) and (Owner.Owner <> nil) then
|
||||
Owner.Owner.Delete(Self);
|
||||
|
||||
// delete childs
|
||||
HasChildren := false;
|
||||
// unbind all references
|
||||
Unbind;
|
||||
if Owner<>nil then begin
|
||||
if Owner.Owner<>nil then
|
||||
Owner.Owner.Delete(Self);
|
||||
|
||||
if Owner<>nil then
|
||||
dec(Owner.FCount);
|
||||
end;
|
||||
|
||||
Data := nil;
|
||||
// free data
|
||||
if FItems<>nil then begin
|
||||
|
Loading…
Reference in New Issue
Block a user