If I place a RadRichTextBox in a RadWindow, then right-click to display the context menu, memory is not released when the RadWindow is dismissed. How can I get the RadRichTextBox to release the memory?
I have a sample project that I can send you.
The ANTS memory profiler output is attached.
3 Answers, 1 is accepted
0
Boby
Telerik team
answered on 28 Jun 2013, 06:26 AM
Hello John,
We can continue our conversation in the support ticket you opened.
Regards,
Boby
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely. Sign up for Free application insights >>
ContextMenu is loaded with MEF, which internally caches the instance, and it holds a reference to the RadRichTextBox.
One simple workaround is to avoid the caching using the workarounds listed in the item: - manually set different instances of ContextMenu to all your RadRichTextBox-es:
this.radRichTextBox.ContextMenu = new Telerik.Windows.Controls.RichTextBoxUI.ContextMenu();
- Create custom context menu that will be non-sharable. MEF will automatically load different instances of it for all RadRichTextBoxes on demand:
PartCreationPolicy(CreationPolicy.NonShared)]
[CustomContextMenu]
public class NonSharedContextMenu : ContextMenu
{
}
If this is not your case, I would suggest opening a separate support ticket and send us sample application which reproduces the problem, along with specific steps to reproduce. Memory leaks sometimes reveals in specific situations, and this will help us pinpoint the issue faster.