You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Imagine we have two classes A and B, both implement IDisposable and A is a dependency for B. Instance of A would be created first. However when kernel disposed, the order in which IDisposable.Dispose() is called for both of them is not defined. This could lead to the situation when dependency become disposed earlier than dependent instances.
The suggestion is to ensure that Dispose on tracked instances is called in reverse order they were created.
The text was updated successfully, but these errors were encountered:
@dombrovsky what's about the situation with 2 IDisposable decorators with conditional bindings? A0 : IAA1 : IA, IA : IDisposable. It is very difficult (or even impossible?) for the container to determine the order of disposing without making resolution process slower (I guess; I'm not a maintainer). We love Ninject not for speed of course ;) but I would prefer a better performance but not auto-dispose.
Imagine we have two classes A and B, both implement IDisposable and A is a dependency for B. Instance of A would be created first. However when kernel disposed, the order in which IDisposable.Dispose() is called for both of them is not defined. This could lead to the situation when dependency become disposed earlier than dependent instances.
The suggestion is to ensure that Dispose on tracked instances is called in reverse order they were created.
The text was updated successfully, but these errors were encountered: