To complete the IDisposable implementation template, it includes a finalizer (destructor) for your class that calls the Dispose () method (passes false). This acts as a fail-safe mechanism to get rid of unmanaged objects if the class consumer has not called Dispose ().
~MyClass()
{
Dispose(false);
}
James davies
source
share