Posted by David Longley on April 22, 2001 at 05:12:39:
In Reply to: destroying creature* posted by kaden yealy on April 21, 2001 at 12:49:02:
If you make your destructor virtual in your abstract class then it will store an extra pointer in its virtual table to destructors--it will call the destructor of the class an abstract pointer is pointing at....thus deleting the data stored where your list of pointers is pointing and the pointers themselves.
: I am getting a debug assertion failure at tehn of my program. Which I assume is because I am not deleting the pointers in my list correctly. Does anyone know how to delete all the pointers and delete the list , to be put in a destructor.
Post a Followup