Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Static Appearance and memory leak
posted

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 ?