I was having a discussion with a colleague recently about the value of Dispose
and types that implement IDisposable
.
I think there is value
In one of my projects I had a class with managed threads inside it, we'll call them thread A, and thread B, and an IDisposable object, we'll call it C.
A used to dispose of C on exiting. B used to use C to save exceptions.
My class had to implement IDisposable and a descrtuctor to ensure things are disposed of in the correct order. Yes the GC could clean up my items, but my experience was there was a race condition unless I managed the clean up of my class.