I need some clarification on…
-
… how the CLR — more specifically, the garbage collector — finds the classes which implement the
IDisposableinterface; and -
… how it calls the
Disposemethod (of all classes which implement theIDisposableinterface) to free up memory?
The CLR does not call Dispose(), this is up to user code to call either directly or through the use of the
usingstatement. The CLR will however call finalizers, although this is not gauranteed.