Description

Objects that need to free resources that cannot safely be reclaimed by the garbage collector implement the System.IDisposable interface.

It is a version-breaking change to add the System.IDisposable interface to an existing class, as it changes the semantics of the class.

[Note: System.IDisposable contains the System.IDisposable.Dispose method. The consumer of an object should call this method when the object is no longer needed. The System.IDisposable interface is generally provided for the release of unmanaged resources that need to be reclaimed in some order or time-dependent manner. It is important to note that the actual release of these resources happens at the first call to System.IDisposable.Dispose for any given object that ...

Get .NET Framework Standard Library Annotated Reference, Volume 1: Base Class Library and Extended Numerics Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.