yes, if the factory resolves Foo, then after calling factory.Dispose(), Foo will get disposed. my problem is that the
factory itself doesn't get disposed, despite calling Dispose.
my scenario is "give me a transient factory which can create a certain set of components". so i'd have something like:
public interface IFactory<T> : IDisposable { T[] Get(); }
and then i would inject into something else like this:
public Foo(Func<IFactory<Bar>> barFactory) { }
and when i want to use the code, it'd be something like this:
using (var factory = this.barFactory()) {
var bars = factory.Get();
// do stuff
}
despite wrapping the factory is a using block, Windsor is still tracking it.