Thanks for that. I'd tend to agree re: Disposable and we have gotten away with it for a long time. It is particularly annoying since the dependency is actually Singleton, which shouldn't really need releasing by the container
A couple of other things to add:
We seem to be able to work around the handler issue by pre-installing the Handlers as PerWebRequest (allows CW to call release on request end..) - e.g.
container.Register(
AllTypes
.FromAssembly(Assembly.GetExecutingAssembly())
.BasedOn<IOpenRastaHandler>()
.WithService.Self());
We found a similar issue with a new OperationInterceptor with depended on the same thing as the handler which we have resolved by
pre-installing IOperationInterceptorProvider (the problematic transient component)
container.Register(
Component.For<IOperationInterceptorProvider>()
.ImplementedBy<SystemAndAttributesOperationInterceptorProvider>()
.LifeStyle.PerWebRequest);
Does this seem acceptable as a work around?
On Tuesday, July 3, 2012 4:07:44 PM UTC+1, SerialSeb wrote:
The current handler is in ICommContext.PipelineData, you can get that from castle itself. After that, calling the release on the handler in the method you talk about should work.
That said, I simply don't implement IDisposable on stuff that goes through castle, it is evil.
I have a much much nicer design for OW / OR3 that uses a simpler concept of scopes. Ah if I had all the time in the world to code :)
Subject: [openeverything] Memory Leak using Castle Windsor with OpenRasta and Disposable sub-dependencies