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
355
Memory leak on UltraWinTree
posted

Hi,

  we noticed a severe issue of memory leak using a binded UltraWinTree; our tree is binded to a collection of classes: we fill in and empty this collection but when this collection is empty, classes previously showed in the tree (and then disposed) remain alive. It seems that the tree element stores a pointer to the classes inside an internal field named nodeClientAreaUIElement

Note : we don't have to dispose the tree until the program is closed because its possible to refill the collection more times.

In attach a little sample reproducing our issue.

Is there a solution to avoid this issue? Will it be fixed in the future releases ?

(issue found on release 11.1)

Best regards

 

 

 

Parents
  • 4940
    Offline posted

    mauro_sturaro said:

    Hi,

      we noticed a severe issue of memory leak using a binded UltraWinTree; our tree is binded to a collection of classes: we fill in and empty this collection but when this collection is empty, classes previously showed in the tree (and then disposed) remain alive. It seems that the tree element stores a pointer to the classes inside an internal field named nodeClientAreaUIElement

    Note : we don't have to dispose the tree until the program is closed because its possible to refill the collection more times.

    In attach a little sample reproducing our issue.

    Is there a solution to avoid this issue? Will it be fixed in the future releases ?

    (issue found on release 11.1)

    Best regards

    Tomorrow I'll check to make sure this bug was entered into the system so it gets fixed and enter it if necessary. As a possible work around until the release that fixes the bug, you could do something as below to kill off the memory reference for garbage collection.

     

    private void btClear_Click(object sender, EventArgs e) {
        ultraTree1.SelectedNodes.Clear();
        _Source.Clear();
    
        if (ultraTree1.UIElement != null)
        {
            if (ultraTree1.UIElement.ChildElements.Count > 0)
            {
                if (ultraTree1.UIElement.ChildElements[0] is Infragistics.Win.UltraWinTree.NodeClientAreaUIElement)
                {
                    ultraTree1.UIElement.ChildElements[0].Dispose();
                    ultraTree1.UIElement.ChildElements.Add(new Infragistics.Win.UltraWinTree.NodeClientAreaUIElement(ultraTree1.UIElement));
                }
            }
        }
    }
    

     

Reply Children