How to check if object has been disposed in C# [duplicate]
The reliable solution is catching the ObjectDisposedException. The solution to write your overridden implementation of the Dispose method doesn’t work, since there is a race condition between the thread calling Dispose method and the one accessing to the object: after having checked the hypothetic IsDisposed property , the object could be really disposed, throwing the … Read more