May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Dispose and the IDisposable InterfaceOne 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, meaning that unused references will still remain in memory until the GC kicks in, and generally this is not a good idea. It is instead a good approach providing 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 ...
Read now
Unlock full access