Hi,
I'm using Infragistics4 v12.1 with my winform application and decided to build dynamically the TreeNodeCollection attached to my UltraTree.This TreeNodeCollection contains one root node and multiple child nodes on potentially a lot of levels (depth).
I figured it would be more efficient to create this TreeNodeCollection instead of binding a collection.In the class that builds the TreeNodes hierarchy, I also set some Appearances on the cells based on their values.
I thought it would be a good idea to keep these Appearance instances as static references of that building class since they would be used multiple times (thousands).
By doing so, I realized that the TreeViewNodes are not Garbage Collected, even if they were disposed manually. So I'm back to cloning as many instances of the Appearance instances as the number of cells that should display a green background for example.
Is there a better way to do it ? Is this memory leak normal ?
If you dispose the node and it's still not getting garbage collected, then that's a bug. Can you post a small sample project demonstrating this behavior?
Hi Mike,
Thanks for your answer. I've attached here the project I'm using to investigate this particular case.
You will see in the TreeNodeBuilder class the two ways to associate Appearance (the leaky one and the non-leaky one).
Thanks,