VB6 object destructor never called
I have a class A, which is allocated at run-time and added to an array. The object has object member variables, from which it receives events.
The problem is that when the object is removed from the array, it still resides in memory, receiving events and processing them, even though it has no references to it. I put a message box in the destructor (Class_Terminate) and that never gets called.
Why doesn't the destructor get called when it has no references?
So now when I remove the object from the array, I add it to a collection called NeedsUnloading, then remove all the objects from that collection periodically. Then, when I remove it, the destructor is called, sometimes.
Using the "End" keyword also means most of my destructors aren't called. Will this cause memory leaks once the program is closed, or just while it is open?
[Edited by - MrEvil on January 19, 2005 11:44:20 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement