May 2010
Intermediate to advanced
1272 pages
61h 18m
English
Dispose and Finalize TogetherImplementing Dispose and Finalize cannot necessarily be required. It depends only on what kind of work your objects perform. Table 8.1 summarizes what and when you should implement.
Table 8.1 Implementing Destructors

You already have examples about Finalize and Dispose, so here you get an example of their combination. Before you see the code, you have to know that you will see invocations to Win32 unmanaged APIs that you do not need in real applications but these kinds of functions are useful to understand to know how to release unmanaged resources. Now take a look at Listing 8.2.
Listing 8.2 Implementing ...
Read now
Unlock full access