Finalizers
Create destructors for user-defined types.
We'll cover the following...
Introduction
Most objects used in C# programs are managed code. Such objects are managed by the CLR and are easily cleaned by the garbage collector. There are also objects that involve unmanaged resources, however (connections to files, databases, network connections, and so on). These unmanaged objects access the operating system APIs. The garbage collector can handle managed objects, but it doesn’t know how to dispose of unmanaged resources. In these cases, we must implement the cleanup means by ourselves.
The release of unmanaged resources implies the implementation of one of two mechanisms: creation of a destructor or ...