Weak References and Disposable objects.
- by Steve Sheldon
In C# it is possible to create weak references to objects as described here:
WeakReference Class
In .net some classes also implement the IDisposable interface. Calling the Dispose method of this interface is performed to manually dispose of any managed or unmanaged resources currently being held onto. An example might be a Bitmap object or class.
If I assign an object that implements IDisposable to a weak reference, will Dispose be called if the weak reference collects the object?