Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2010 Visual Basic Destructor

$
0
0
In Visual Basic.NET, am I correct in saying that the following code is correct for a destructor?

Code:

    Protected Overrides Sub Finalize()

        MsgBox("Finalize")

    End Sub

I am asking this question because when I add this code to a class, the MsgBox("Finalize") is called twice.
Should this happen? Is the above code correct?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>