LCL: Add a sanity check to TTreeNode.Unbind.

git-svn-id: trunk@64143 -
This commit is contained in:
juha 2020-11-16 22:20:11 +00:00
parent 2a0df745f0
commit 92568b2c46

View File

@ -1300,6 +1300,7 @@ begin
// remove single select
Selected:=false;
TheTreeView:=Nil;
// invalidate caches of TreeView and if root item, remove from TreeView.Items
if Owner<>nil then begin
Owner.ClearCache;
@ -1347,6 +1348,7 @@ begin
ReAllocMem(FParent.FItems,SizeOf(Pointer)*FParent.FCapacity);
end;
if FParent.Count=0 then begin
Assert(Assigned(TheTreeView), 'TTreeNode.Unbind: TheTreeView=Nil.');
TheTreeView.BeginUpdate;
try
FParent.Expanded:=false;