Memory allocation problems ?
Mukund Seshadri
mukund at WPI.EDU
Mon Aug 12 12:17:01 EDT 2002
I'm using a ptr to an object in a GATreeGenome object and I'm having a
memory leak. Now ideally I should have the ptr enclosed in an object that
does all the checking and frees the memory when appropriate but having
already commited myself to the simple pointer, I was wondering if I had to
rewrite the program with a pointer class or maybe I could call an
appropriate destructor.
So I declared a GATreeGenome<MyNodePointer>::~GATreeGenome destructor but
I find its not getting called.
My program calls ga.step (for the GASStateGA) and I notice that the tmpPop
is just replaced .. should it also be calling a delete or does that
happens elsewhere ? Did I miss something ?
Thanks.
-Mukund Seshadri
More information about the galib
mailing list