Jump to content
  • Advertisement
Sign in to follow this  
MrEvil

VB6 object destructor never called

This topic is 4931 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!