icsharpcode / AvalonEdit

The WPF-based text editor component used in SharpDevelop
http://avalonedit.net/
MIT License
1.86k stars 470 forks source link

Objects not being destroyed #420

Open BernardinoGoncalvesLynx opened 9 months ago

BernardinoGoncalvesLynx commented 9 months ago

Hello friends, I hope you are well, I have the following difficulty, I have a WPF application using .net framework 4.7.2 where I have a main window that when clicking on a button opens a second window that contains the editor, but a memory leak was noticed and during the investigation with dotMemory we noticed that the AvalonEdit objects were not being destroyed, and each time the window was opened new objects were created. To validate, I created a new project where the window only had the AvalonEdit component and no other events or objects linked to it, and even so the object was not being destroyed when closing the window. Some points that may help, In the last test there was no data input to AvalonEdit, no text or files were loaded into the component, nor were they added to the component input.

siegfriedpammer commented 9 months ago

Would you be able to provide full example app that shows the memory leak?

I created the following application, which creates new windows on button click (and I can see the memory usage go up in the diagnostic tools/debugger), but the memory usage drops as soon as I start closing the windows again.

WpfApp4.zip

Thanks!