July 2015
Intermediate to advanced
1300 pages
87h 27m
English
One of the issues of the Finalize destructor is that you cannot determine whether resources will be freed up and when an object will be physically destroyed from memory. This is because of the nondeterministic nature of the garbage collector—unused references will still remain in memory until the garbage collector kicks in, which is not a good idea. A better approach is to provide clients the ability to immediately release resources (such as network connections, data connections, or system resources) just before the object is destroyed, setting it to Nothing. The .NET Framework provides a way for releasing resources immediately and under your control, which is the Dispose method. Implementing ...