I’m sure you’d agree that finalization is fascinating. And there’s even more to it than what I’ve already described. You’ll notice that when an object requiring finalization is considered dead, the garbage collector forces the object back to life so that its
Finalize method can be called. Then after its
Finalize method is called, the object is permanently dead. To summarize: an object requiring finalization dies, lives, and then dies again. This very interesting phenomenon is called resurrection. Resurrection, as its name implies, allows an object to come back from the dead.
The act of preparing to call an object’s
Finalize method is a form of resurrection. When the garbage collector places a reference to the object on the freachable ...