Deconstructor not firing...

Started by
20 comments, last by sirSolarius 19 years, 10 months ago
Yes, I think the AP is right - if the compiler has a forward declaration of a class but not the whole definition and you try to delete a pointer to that class, it doesn't call the destructor. I tried a quick example of this and fortunately, MSVC gave me a warning about this, warning C4150. Make sure that MemoryManager.cpp includes MemObj.h into it so that it knows about MemObj's destructor.

[Edit] Oh yeah, and make sure to keep your warning level high. I got this warning on levels 2 and above, but not on level 1 (and obviously not on the None setting either). You wouldn't have had to bang your head on the wall for days waiting for the above AP's brilliance if you'd just had your warning level high enough. [/Edit]

[edited by - aprosenf on June 9, 2004 12:43:44 PM]
Advertisement
virtual destructors?

This topic is closed to new replies.

Advertisement