PerThreadLifetimeManager in Unity

Posted by DorianGrey on Stack Overflow See other posts from Stack Overflow or by DorianGrey
Published on 2010-05-17T00:07:12Z Indexed on 2010/05/17 0:50 UTC
Read the original article Hit count: 679

Filed under:
|
|

Hi,

In the Unity PerThreadLifetimeManager documentation, I read that: "This lifetime manager does not dispose the instances it holds". Ref.: http://msdn.microsoft.com/en-us/library/ff647854.aspx

So, if I am using a ThreadPool, does it mean that objects resolved using Unity on a Thread of the ThreadPool will not get disposed at the end of the work done in that thread before being returned to the pool?

Any pattern or ideas how I can ensure that the objects do get disposed & I get a clean thread from the thread pool?

Thanks!

© Stack Overflow or respective owner

Related posts about c#

Related posts about unity