Jump to content
Xtreme .Net Talk

MyBase.Finalize() ??


Recommended Posts

Guest Imogen
Posted

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

  • *Gurus*
Posted
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.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Guest Imogen
Posted
so if you dont have a base class then it does nothing?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...