I am trying to extend the TTreeView class.
How do I ensure that the memory of the object (it will always be an object) that is assigned to TreeNode.data is freed whenever a node is deleted in statements such as TV.Items.Clear?
I understand something like:
TNodeData(TV.Selected.Data).Free;
TV.Selected.Delete;
wil do but what if CustomTV.Items.clear is called or when the application is terminated? I can't even override TTreeCustomView.Clear or TTNode.Delete methods.
Any help is appreciated
David
How do I ensure that the memory of the object (it will always be an object) that is assigned to TreeNode.data is freed whenever a node is deleted in statements such as TV.Items.Clear?
I understand something like:
TNodeData(TV.Selected.Data).Free;
TV.Selected.Delete;
wil do but what if CustomTV.Items.clear is called or when the application is terminated? I can't even override TTreeCustomView.Clear or TTNode.Delete methods.
Any help is appreciated
David