Tech Off Post

Single Post Permalink

View Thread: On the topic of Object Immortality
  • User profile image

    Let's say I have the following class:

    public class Immortal
        private static System.Collections.ArrayList immortals = new System.Collections.ArrayList();

        public Immortal()

            // rise from your grave!

    If I then do the following:

    Immortal being = new Immortal();

    being = null;


    Will the program hang waiting for an immortal object to die?

    I know that the docs don't guarantee that WaitForPendingFinalizers will ever return, but I'm just curious if this will hang it.