The code review checklist in my new client place has the following –
Class implementing Dispose and Finalize should have a call to GC.SupressFinalize in Dispose implementation
Why?
Should it not read as Class implementing IDisposable interface should have a call to GC.SupressFinalize in the Dispose implementation?
Or Am I missing something silly?
You’re missing the fact that not every disposable class needs a finalizer – in fact, very few do, particularly due to .NET 2.0’s
SafeHandletype. If there’s no finalizer, why would you need to callSuppressFinalize?