Sign in to follow this  

VB6 object destructor never called

This topic is 4715 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites

This topic is 4715 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this