Problem with destructors.
I'm working on a slightly complex application and I have a problem. A few destructors are not getting called when the program quits.
I have a few classes, all are initialized just fine, the program runs fine, no crashes or anything. The problem is that when I quit I find a lot of memory leaked. I checked everything and I was able to fix some of them, the problem was that I was not freeing those variables. But I have a problem where memory is leaked at exit even though I free the momory in the destructor. Basically its
OBJECT_MANAGER which manages all the Objects, then here are loaded the Objects from a file, when the text is parsed a new OBJECT is created. In the OBJECT class there are different classes depending on the parsed text. If its is a sound then SOUND_MANAGER is called and depending on the sound format it may call the MP3_CLASS or OGG_CLASS. The problem is that the OBJECT destructor is not called at exit so nothing is freed, I end up with a lot of memory leaked. How can I make sure that the destructor of each class gets called?