Call the Dispose method in the Finalize method and in the Dispose method to suppress the Finalize method from using "GC.SuppressFinalize". The following is the sample code of the pattern. This is the best way to clean our unallocated resources, and yes do not forget, we do not get the hit of running the Garbage Collector twice.
public class CleanClass : IDisposable
{
public void Dispose()
{
GC.SuppressFinalize(this);
}
protected override void Finalize()
{
Dispose();
}
}