Could someone explain what might happen if you don\'t Dispose
some IDisposable
entity (by using
or direct Dispose
cal
One distinction that is worth pointing out is that .NET manages memory, but not resources. IDisposable
is designed so that clients of classes implementing this interface can dispose resources deterministically.
Joe Duffy states the distinction pretty clearly in his post entitled DG Update: Dispose, Finalization, and Resource Management:
The CLR’s garbage collector (GC) does an amazing job at managing memory allocated directly to CLR objects, but was explicitly not designed to deal with unmanaged memory and OS-managed resources.