Thank you for the question.
I tested your scenario using the provided code snippet. I noticed that numerofpagecontrols
will never be equal to one, because the Name
of the RadDock instances is not set to 'radDock1'. If I set the Name
of the dock instances to 'radDock1', the code which disposes the RadDock instances is executed.
Please note, however, that when you call the Dispose on a RadDock instance, the allocated resources related to this instance are not freed immediately. RadDock has a deep graph of instances, which results in a longer lifetime for some of the internal instances. However, sooner or later, after several GC.Collect() passes the appropriate instances are disposed correctly. You can check this by calling the GC.Collect()
Still, we found an issue with the pages of RadPageView which are not disposed when they are closed. We will address this issue in one of our next releases.
I am attaching a sample project which demonstrates that the RadDock resources are freed correctly. Just open 20 pages with RadDock, then close them and finally click the GC.Collect button several times. You will notice that the memory consumption will be decreased. Some memory will stay allocated, because of the static resources related to the theming mechanism of RadControls.
Your Telerik points have been updated for your feedback. If you have additional questions, feel free to contact me.
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking
system and vote to affect the priority of the items