Object Resurrection
With the object resurrection phrase, we describe the scenario in which an object is restored after its reference was removed, although the object was not removed yet from memory. This is an advanced technique, but it is not very useful and Microsoft strongly discourages you from using it in your applications. It is helpful to understand something more about objects’ lifetime. Basically an object being finalized can store a self-reference to a global variable, and this can keep the object alive. In simpler words, a reference to a “died” object is restored when within the Finalize method the current object is assigned (using the Me keyword) to a class level or module level variable. Here’s a small code example for demonstrating ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access