MyBase.Finalize() ??

  • Thread starter Thread starter Imogen
  • Start date Start date
I

Imogen

Guest
In VB.Net New() and Finalize() functions have replaced the Class_Initialize() and Class_Terminate() of VB6.

However when I create the finalize function I get the line

MyBase.Finalize()

What do this mean/do?

Taken from the VB.Net created routine

Protected Overrides Sub Finalize()
MyBase.Finalize()
End Sub

Thanks

Imogen
 
Your Finalize event is where you clean up objects in your class, but if your class derives from another, that line Invokes the Finalize method in *that* class as well, so it has a chance to clean up properly at the same time.
 
I think if you dont specify a base class to inherit from, it will implicitly inherit from Object, so there will always be a base class.
 
Back
Top