Posted by Daniel Longest on April 18, 2001 at 00:03:43:
In Reply to: Re: About Memory Leaks posted by Aaron Faust on April 17, 2001 at 18:58:44:
remove will not call delete on the object, you will have a memory leak. It will only destroy that value internal to the list.
: I assume that you are using the STL list. Why not just call list.remove(Creature* X). This way, the list takes care of searching and deleting for you - all dynamic memory is deallocated via the list implementation.
Post a Followup