LCL: treeview: trigger OnDeletion() event before node is unbinded.Fixes issue #17832 .

git-svn-id: trunk@28092 -
This commit is contained in:
zeljko 2010-11-05 09:23:09 +00:00
parent ab18b9f85b
commit 674800cb1b

View File

@ -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