Why do some people use the
Others have already covered the difference between
Finalize (btw the
Finalize method is still called a destructor in the language specification), so I'll just add a little about the scenarios where the
Finalize method comes in handy.
Some types encapsulates disposable resources in a manner where it is easy to use and dispose of them in a single action. The general usage is often like this. Open, read or write, close (Dispose). It fits very well with the
Others are a bit more difficult.
WaitEventHandles for instances are not used like this as they are used to signal from one thread to another. The question then becomes who should call
Dispose on these? As a safeguard types like these implement a
Finalize method, which makes sure resources are disposed when the instance is no longer referenced by the application.