MEF keeps reference of NonShared IDisposable parts, not allowing them to be collected by GC

前端 未结 4 1792
一整个雨季
一整个雨季 2020-12-09 05:11

I\'ve encountered somewhat of a problem in MEF\'s part lifetime which causes memory leaks in my Prism application.

My application exports views and viewmodels with t

4条回答
  •  醉话见心
    2020-12-09 05:24

    All the other answers provide good ways to circumvent this issue, but what I ended up doing eventually was using my own custom interface, ICleanup, instead of IDisposable. This of course may not be suitable for everyone.

提交回复
热议问题