Tag: listcollectionview

ListCollectionView泄漏内存吗?

我一直在研究如何避免因视图模型对INotifyCollectionChanged事件的强引用而导致的内存泄漏。 我正在使用ListCollectionView来查看是否会为我处理它。 我认为以下是泄漏记忆,我做错了什么? var stuff = new ObservableCollection(); while (true) { var result = new ListCollectionView(stuff); // Just to keep make sure that the memory I’m seeing // isn’t waiting to be GC’d GC.Collect(); }