Class Finalize - how to kill a class

  • Thread starter Thread starter SimpleMan75
  • Start date Start date
S

SimpleMan75

Let's say I have a class - so to instanciate it, I put :
dim cWhatever as New myClass

My question is, do I need something to remove it from memory, once the
form's closed?

What are the recommended ways of doing this (in the class itself/in the form
disposed event, or where/how)?
 
My question is, do I need something to remove it from memory, once the
form's closed?

No, that's the job of the garbage collector. It will take care of the
object once you no longer hold any reachable references to it.


Mattias
 
If the class implements IDisposable, you should call the Dispose method when
finished using it, unless it is a Control that is added to the Components
collection of the Form, in which case the Form will handle the disposing of
it.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
Back
Top