KeysCoder
Member
I'm not exactly a newbie but I need a better understanding of how .net deals with instances of classes that are no longer used.
The way I understand it, the garbage collector will only reclaim resources when it needs to. So if I declare an instance of a class with a procedure-level variable, what happens after the procedure executes? The variable no longer exists but what about the instance of the class? It should still be in memory. Won't an entirely new instance be generated and abandoned every time the procedure executes?
The way I understand it, the garbage collector will only reclaim resources when it needs to. So if I declare an instance of a class with a procedure-level variable, what happens after the procedure executes? The variable no longer exists but what about the instance of the class? It should still be in memory. Won't an entirely new instance be generated and abandoned every time the procedure executes?