Dirkster99 / AvalonDock

Our own development branch of the well known WPF document docking library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LayoutDocument leaks on close

ladych opened this issue · comments

It seems that LayoutDocument needs to be freed somwhere after the Document Pane is closed. Here is small Reproducer. It seems that Document is hold by private property of Docingmanager it self. Is there any correct way to Free Document After it is closed?
AvalonDocPanelMemoryLeaks.zip

I have clear all of the references of this usercontrol on the demo created,but when I check the memory,there is a stack not recycling,Make sure this Load of HeavyLoad will be collected by GC.Help me double check my pull request LyonJack@6ec1e30 will work well
@ladych @Dirkster99

When I change the demo code to
image
Then when Click the button,this memory is still growing

As I mentioned: The only link which holds LayoutItem object is _layoutItems of DockingManager if you removes it from DockingManager everything is fine.
Hereis an object graph after you create Document and close it:
grafik

1593765119(1)
I means I have do some jobs to clear the references,and I have pull request, wait a new version,or take my fork to test it

@ladych
I was able to verify the result that LyonJack shows here. The AvalonDocPanelMemoryLeaks project is now merged in the current branch. Please feel free to give feedback if you still do not see this resolved.