ExcalibursZone
Jun 5th, 2001, 08:45 AM
I've posted this before, got an answer in the com/active x forum, but non-helpful as it pertained very little to my problem. Here's the situation:
An object that I've created will not terminate properly. The program does not terminate abnormally (ie end, an error, etc.) and in actuality after I set the object to nothing it continues to use subs and functions that are located within it. When the system timer checks to see if the socket's status is connected, (the system timer is shared by all objects in game) it sends a signal to the object to shut down. The annoying part is: This object is the one that doesn't terminate properly.
Now, I store all active player objects in a dictionary. This is great for the sheer ease of checking if a name is already in use. Anyway, I am using a wrapper class around the dictionary, which is great because I've added quite a bit of extra functionality to it. When I send the player object to be added to the dictionary, should I set it as ByRef or ByVal? I understand the difference between the two methods. (ByRef more or less sends a pointer to the actual object, ByVal sends a copy of the object.) How would I go about the release & destruction sequence? IE: Should I set the object to nothing and then remove it from the dictionary? or visa versa?
I did some testing and found that if I don't set a player object to nothing but just remove it from the dictionary the class_terminate will go off. (IE initial listen object gets set then added then removed in that order and the terminate event will fire.)
If anyone can help me sort this out, please let me know. Thanks.
An object that I've created will not terminate properly. The program does not terminate abnormally (ie end, an error, etc.) and in actuality after I set the object to nothing it continues to use subs and functions that are located within it. When the system timer checks to see if the socket's status is connected, (the system timer is shared by all objects in game) it sends a signal to the object to shut down. The annoying part is: This object is the one that doesn't terminate properly.
Now, I store all active player objects in a dictionary. This is great for the sheer ease of checking if a name is already in use. Anyway, I am using a wrapper class around the dictionary, which is great because I've added quite a bit of extra functionality to it. When I send the player object to be added to the dictionary, should I set it as ByRef or ByVal? I understand the difference between the two methods. (ByRef more or less sends a pointer to the actual object, ByVal sends a copy of the object.) How would I go about the release & destruction sequence? IE: Should I set the object to nothing and then remove it from the dictionary? or visa versa?
I did some testing and found that if I don't set a player object to nothing but just remove it from the dictionary the class_terminate will go off. (IE initial listen object gets set then added then removed in that order and the terminate event will fire.)
If anyone can help me sort this out, please let me know. Thanks.