I have noted that when I close a window that has a XamRichTextEditor control on it the window stays in memory, however that same window with no text editor on it will be garbage collected as expected when closed. This is of great concern to the application I would like to use your control with since the particular window I am loading up with the XamRichTextEditor could potentially have a large amount of memory allocated.
I use Red Gate Memory profiler 8 in order to inspect memory since visual studios does not help a lot in this respect. I would like to past the image of the reference chain it shows however I cannot seem to get a image to go in this text box. :)
Is there some simple method I can call when closing my window to ensure the garbage collector can grab this control?
Regards,
Aaron
Hello Aaron,
Thank you for your post!
I have been looking into the issue you have described. I have created a small sample application in order to test it and I was not able to reproduce the issue. I have been testing the sample application with Ants Profiler.
I am attaching the sample application I have been testing with. Would you please modify it with the functionality you are using, so it shows the issue? This way I would be able to further investigate the issue for you.
Thank you for the cooperation. Looking forward to hearing from you.
I downloaded the application you provided and the behavior repeated instantly for me :( The issue was when the RichTextEditorWindow that was opened on this form it never caught its closed event and set the reference to null. I have done that and I have made a button that will add the text editor to the window after it loads. Load it once, do not add the text to the window and close the window, you will note that when taking a snapshot from the memory profiler that the RichTextEditorWindow will be collected and no longer show up in the snap shots. However if you click the button that adds the rich text editor to the window and close it the RichTextEditorWindow will remain in memory.