Search code examples
c#castle-dynamicproxy

Castle Interceptor Life Cycle and Memory Leak


I am new to castle dynamic proxy, and a bit curious..

When creating proxy of my object I save all the original values of its property on the interceptor (class scope) using dictionary and return the new value. Now I am wondering, when will this data get collected by GC?? Can i control it or does it depend on the interceptor life cycle?

Regards Kin


Solution

  • Interceptor is just an object that the proxy holds reference to. So it will live at least as long as the proxy.