Will the Garbage Collector call IDisposable.Dispose for me?

The .Net Garbage Collector calls the Object.Finalize method of an object on garbage collection. By default this does nothing and must be overidden if you want to free additional resources.

Dispose is NOT automatically called and must be explicity called if resources are to be released, such as within a ‘using’ or ‘try finally’ block

see http://msdn.microsoft.com/en-us/library/system.object.finalize.aspx for more information

Leave a Comment