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
490
Disposed object is retained by UltraToolbarsManager's EventHandler
posted

We have a memory leak issue due to controls being retained by UltraToolbarsManager.

Here is the architecture we have: Control1 has a UltraToolbarsManager. Control1 creates several Control2 objects in tabs. Control2 objects have also UltraGrids. We use the UltraToolbarsManager of Control1 to set the contextMenuUltra's of the UltraGrids of the Control2 objects.

As we close the Control2 objects via tabs, we realize that those Control2 objects are not disposed off the memory entirely, because they are retained by Control1.UltraToolbarsManager.contextMenuUltras.

In order to overcome this issue, we have tried Control1.UltraToolbarsManager.SetContextMenuUltra(UltraGridXYZ, null). However, we realized that even though UltraGridXYZ was disposed, the Control2 object was still retained in the memory, via UltraToolbarsManager.contextMenuUltras.val[]..._target.

Is there a way to detach the Control2 object from the UltraToolbarsManager at the end of its life cycle so that it doesn't remain in the memory? Or shall we maintain a separate UltraToolbarsManager for each Control2 object, that we create?

Parents
  • 12480
    Offline posted

    Hi Burak,

    If I am understanding your description correctly, it seems that Control1 is retaining references to the Control2 objects, which prevents the garbage collector from releasing them and their associated controls. You should be able to release the memory by calling Dispose on the Control2 objects once you are done with them.

    Please try this out and let me know whether it works.

Reply Children