The Windsor monitors Transient instances only if they have some problems with the failure. A typical example of a disconnect problem is that the class implements the IDisposable interface.
So, if IThing is Transient , and it does not implement IDisposable , and it has no other problems associated with the failure, then Windsor will NOT track it, and the garbage collector can / will delete IThing instances.
BUT (and this is big, but) , I suggest you never rely on this behavior. IThing may be changed by the developer, and it may become one-time in the future. Or it may cause another write-off problem. And suddenly a memory leak occurs. Therefore, a simple rule should be observed:
Each time an object is explicitly resolved by calling container.Resolve , it must be freed by calling container.Release . Also, at any time when an object is explicitly created using a typed factory, it must be explicitly destroyed by the printed factory. It does not matter if the object is temporary or not, take care of its life span. Always. The creator of the object (whether windsor or typed factory) is responsible for destroying the object.
Basically, @piotrwest was right in his comment. However, this answer aims to explain that this is not just about IDisposable - about problems with decommissioning ( IDisposable is just one of them).
This wonderful article explains more details.
source share