Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Unassigned: AvalonDock DocumentsSource binding cause memory leak [22293]

$
0
0
After I update AvalonDock to Ver.3.0.16174.17450, I've got memory leak.
It occurs even in the simplest case.
(only binding DocumentsSoure with ObservableCollection<object>)
Here are some screenshot to show what is happened.

1st image shows after my test app launched. It took only 2MB.
2nd image shows after add some documents. It took 21MB and GC can't reduce this, but it's OK.
3rd image shows after I delete all documents and run GC. It still took 21MB.
![Image](http://i.imgur.com/g9NBSTt.png)
![Image](http://i.imgur.com/RQvZmKa.png)
![Image](http://i.imgur.com/IAwvcLm.png)

And if I repeat this process, test app devours RAM.
Attached project is test app in screen shot.

I think this is critical bug, please check and fix this ASAP.

Cheers.
Comments: ** Comment from web user: hyge **

You're right, I've forgot to remove Document from collections...Sorry for lack of confirmaion.

But if I add "Remove" command in MVVM fashion, there is another issue.
To remove Document from collection, AvalonDock throws NullReferenceException.
Here is some snippet.

```
var workspace = this.DataContext as WorkspaceViewModel;
if (workspace.Documents.Count > 0)
workspace.Documents.RemoveAt(workspace.Documents.Count - 1); //NullReferenceException is thrown.
```

If I "activate" document to close by select it, exception not thrown.

Am I missing something again?
Attached project repro this behavior.
"Add" twice or more and "Remove", then, Exeption thrown.

And maybe Michael_Brave reported [here](https://avalondock.codeplex.com/workitem/17673) is the same issue.

Regards.


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>