0

In my class which inherited TreeViewItem I used a field to store the parent TreeView object

TreeView _parentTreeView

Since TreeView will definitely have a reference to the TreeViewItem while the TreeViewItem holds a reference to the parent. Will this prevent both TreeView and TreeViewItem from being garbage collected?

Steve
  • 11,696
  • 7
  • 43
  • 81
  • 1
    If the root reference to treview is not accessible anywhere, It may be collected.. – L.B Oct 11 '16 at 17:11
  • C#/.Net does not use reference counting for garbage collection. It uses graph theory to know when items are no longer "rooted" to determine that they are no longer reachable by the program. – Joel Coehoorn Oct 11 '16 at 17:18

0 Answers0