Hi,
assuming VB.NET, if you do
<br />[1] Dim MyObject As Object<br />[2] MyObject = New Object ' object 1<br />[3] MyObject = New Object ' object 2<br />
then object 1 will become collectible when line [3] executes, meaning the garbage collector will collect object 1 the next time it runs (normally it runs when a future memory allocation cannot be satisfied without cleaning up memory first).
And this is fine, unless it is a type that implements Dispose or Close, as in:
<br />[1] Dim MyObject As Font<br />[2] MyObject = New Font(...) ' object 1<br />[4] MyObject = New Font(...) ' object 2<br />
now you should insert
[3] MyObject.Dispose()
to make sure the unmanaged resources that might be held by the object get released right away (or the file or stream or whatever gets closed).
If you don't Close/Dispose objects that support it, your app will use more memory and other system resources, and its behavior may deteriorate. Yes, the garbage collector will still find those objects, and its finalizer thread will eventually Dispose of them, but that typically will be much later.
:)