B
brianhray
Hello,
Say I have a map:
typedef map< MyString, const char* > MyMap;
The char* are being new'd. Do these needed manually deleted or are they
deleted in the destructor? I know if the map was using std:string they
would be freed.
If so, in *my* destructor where mMyMap is a memeber, I am trying:
for ( MyMap::iterator iter = m_mymap.begin(); iter != m_mymap.end();
iter++ )
delete [] (*iter).second;
Although, how do I know these are getting freed? Is there some sort of
test I can add. I tried to assing the (*iter).second to the const char*
but in the debugger this makes it look like these did not get deleted.
-- Brian Ray
Say I have a map:
typedef map< MyString, const char* > MyMap;
The char* are being new'd. Do these needed manually deleted or are they
deleted in the destructor? I know if the map was using std:string they
would be freed.
If so, in *my* destructor where mMyMap is a memeber, I am trying:
for ( MyMap::iterator iter = m_mymap.begin(); iter != m_mymap.end();
iter++ )
delete [] (*iter).second;
Although, how do I know these are getting freed? Is there some sort of
test I can add. I tried to assing the (*iter).second to the const char*
but in the debugger this makes it look like these did not get deleted.
-- Brian Ray