Posted by Daniel Longest on April 21, 2001 at 14:33:11:
In Reply to: Deletion Question... posted by David Shell on April 21, 2001 at 13:23:21:
If you are storing pointers in the list allocated with new, you will need to delete those but the list will take care of its internal destruction when its destructor is invoked.
: When we need to delete our lists, say in the destructor, I assume it is correct to go through each list, retrieve and remove the pointer to each Creature, and delete the dynamic memory pointed to... Is this correct? Do I also need to in some way delete the stl list itself, or when it goes out of scope, does it handle its own deletion?
Post a Followup