M
Mike
Folks, I'm more of a C/C++ programmer and still learning the final
details of VB "oops"
In VB.NET how do you delete a object? For example
sub DoSomething()
dim u as new TUser("Mike")
....
End sub
I don't see how you deallocate the u instance of Tuser? Should I
presume VB.NET will deallocate this new instance once the local scope
is lost?
Generally, like in C/C++, if you allocate it yourself (new), then you
are responsible for releasing it.
I don't see an issue with this:
sub DoSomething()
dim u as TUser
....
End sub
Because that is an inherit local scope allocation and therefore the
compiler will remove it automatically.
But what about when you use new?
Thanks
details of VB "oops"
In VB.NET how do you delete a object? For example
sub DoSomething()
dim u as new TUser("Mike")
....
End sub
I don't see how you deallocate the u instance of Tuser? Should I
presume VB.NET will deallocate this new instance once the local scope
is lost?
Generally, like in C/C++, if you allocate it yourself (new), then you
are responsible for releasing it.
I don't see an issue with this:
sub DoSomething()
dim u as TUser
....
End sub
Because that is an inherit local scope allocation and therefore the
compiler will remove it automatically.
But what about when you use new?
Thanks