Understanding Destructors in VB.NET
This article is about understanding the working concept of destructor in VB.NET.
The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: Understanding Destructors in VB.NET
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.
kendall morleyPosted May 25, 2007, 1:31 AM
When an instance is destructed, the destructors in its inheritance chain are called, in order, from most derived to least derived. In vb.net you can overide the finalize method and it is upto you to include a call to Mybase.Finalize. So it is possible that the derived finalize is the only finalize to be called. In c# you cannot explicitly override the finalize method and the compiler will place a call to it in the destructor, so it is imposible to forget to cal base.finalize