Can someone help...this used to be so easy in C++ and VB6 :)
I am dynamically creating multiple instances of a fairly simple class, tracking them via the Collections class in vb.net. I loop through the collection if I need to get to a particular instance to set some property, for example. Everything is fine, and works ok until I try to destroy the instances that I created (largely because I am probably not doing it right). What I am doing setting the instance to "nothing". That is, here is the portion of the code:
Dim node As mini_node ''destroy any existing defined nodes... For Each node In nodesCollection node = Nothing Next 'clear the existing collection, if any. nodesCollection.Clear()
The problem is that I don't think the class instances are destroyed (I have a timer event enabled in some instances of the class and they continue to execute, even though I did the =Nothing already !!)
How do I destroy an instance of a class??? Please help a confused soul.
Thanks for any/all help in advance.