VB 2005.
I have the following code in a Sub.
Dim oFred As SillyClass
oFred = New SillyClass
oFred.Gloop()
oFred = Nothing
Exit Sub
The Finalize code in the class does not fire until the .exe is closed.
I expected it to fire at either:-
- the point at which oFred is set to Nothing, or
- the point at which we exit from the Sub, and variable oFred goes out of
scope.
What are the rules governing when the Finalize code runs?
Thanks
Barry
I have the following code in a Sub.
Dim oFred As SillyClass
oFred = New SillyClass
oFred.Gloop()
oFred = Nothing
Exit Sub
The Finalize code in the class does not fire until the .exe is closed.
I expected it to fire at either:-
- the point at which oFred is set to Nothing, or
- the point at which we exit from the Sub, and variable oFred goes out of
scope.
What are the rules governing when the Finalize code runs?
Thanks
Barry
Comment