At 10:16 PM 11/17/2005, you wrote:
Hi All,
I am using
std::list<char*>* dlP
in my program.
when I do
int* val = *(dlP->begin());
dlP->pop_front(),
do I need to make
'delete val' to avoid memory leak ?
probably in unix pop_front() releases the memory also. So we need not
delete the memory exclusively. But is that the case with MSL c++ for Palm os ?
Your list is storing pointers. The pop_front will deallocate the "char *"
that's in the list, but it won't free the memory that the char * points
to. You should encapsulate the char * using something like a std::string
for this to work.
-- Ben Combee, Senior Software Engineer, Palm, Inc.
"Combee on Palm OS" weblog: http://palmos.combee.net/
Developer Forum Archives: http://news.palmos.com/read/all_forums/
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/