Oct 6, 2010 at 11:51 AM
Edited Oct 6, 2010 at 12:17 PM
I've encountered this memory leak in my silverlight application too.
When calling CompositionInitializer.SatisfyImports(this), a ReflectionComposablePart is created, that keeps an instance of the passed object (this._cachedInstance = attributedPart).
I'm using the latest drop on CodePlex (preview 9) but I believe that the same code is used in the SL4 release code (according to reflector).
Is there a way around that ? It's a really big issue in Silverlight app because event aggregator's event handler will keep firing until the instance is released, leading to unexpected results.
I just want to clarify something. The memory leak concerns the object that imports other parts, as opposed to the exported parts themselves. In other words, it is the 'this' of the CompositionInitializer.SatisfyImports(this) that leaks.