I've written a program that allows users to telnet to it; as each connection is made a new instance of a telnet session object is created, which is part of a collection class.
This all appeared to be working fine; objects were created for each session and then subsequently released when the client disconnected. However, i've found a somewhat annoying bug in the program that I shall now explain.
1. Three sessions log on - three objects are created
2. Session 1 disconnects - object is removed from collection
3. Session 1 reconnects - object is created
4. Session 1 disconnects - object is removed from collection
5. Session2 disconnects - object is removed from collection BUT - Class_Terminate event isn't fired - why???
As you can see from the above, when you perform certain actions such as these the class_terminate event isn't fired. If, however, you then invoke any method of the class object, even if it's for a different object, then the class_terminate event is fired - it's almost as if it knows it's got to fire the event but it waits for you to do something before it continues....
Anyone got any ideas?? The class collection and objects are part of an ActiveX EXE that is used by a child programme too....