[Version 2.0] Why AvalonDock blocks a window destructor to be executed?

Sep 17, 2013 at 10:56 PM
Edited Oct 15, 2013 at 2:24 PM
Hi.

I'm developing some windows and pages on an application using .net 4.0 and i'm using AvalonDock. I've noticed when users are running this app, and analyzing all log data, all windows previously opened, they're not being destructed. So, i've removed almost all of User Controls and basic Controls from a window/pages, and I realized that only with AvalonDock on those windows aren't actually destroyed. How can I do to get around this?

Just to clarify the question, I left the window clean (no objects), the destructor is executed. I left with some components and still runs. With AvalonDock, not.
Oct 14, 2013 at 9:10 PM
Please, does anyone have a solution for this problem? The application is almost ready and I don't want to redo multiple screens and windows because of a problem like this.
Oct 15, 2013 at 1:37 PM
I don't think we have enough information to answer your question. Maybe some source code snippets? Are you using the MVVM pattern? etc.

Additionally, I'm unclear what you mean by destructed (I'm assuming you mean finalized)? Are you seeing a memory leak or something?
Oct 15, 2013 at 2:32 PM
Edited Oct 15, 2013 at 2:38 PM
Hello KDeLorey,

yes, i'm using MVVM Pattern and IOC. And Yes, i mean finalized. I don't mean memory leak, i've just noticed when my window/page doesn't have a AvalonDock component, when this page/window is closed, it is finalized. But with AvalonDock, isn't. Another thing is the memory that the application uses. The memory simply does not lower when using AvalonDock.

Some machines are running this application 24/7. Analyzing log file, all destructors of my View/ViewModel call a simple log method to log when that window/page is destructed. Again, with AvalonDock those Destructors/Finalizer Methods aren't called. This means that the Garbage Collector isn't collecting this garbage information (Since those pages/windows are no longer being used).
Oct 15, 2013 at 3:55 PM
Still hard to say what the problem is. Keep this in mind though: If these are Anchorable Windows (Tool Windows), when the user closes the window it will actually hide, not close. This means that your content will still exist within memory. You may need to consider virtualizing data. Otherwise, if you really want to close the window, you may call the Close() method on the LayoutContet you wish to close. Note, removing the window from the layout could mess up any layout serialization you may have.