G
Govindan
stp said:Hello,
I declare the following types:
typedef pair<long, string> CEventPair;
typedef deque<CEventPair*> EventPairCont;
// here I add some new elements
// l is a long
// value is a string
// events is EventPairCont
if ((npair = new CEventPair (l, value)) != NULL) {
events.push_back (npair);
}
// here I do something with this
..
// at the end I use clear-method to destroy all
events.clear ();
After Shutdown Boundschecker reports me Memory leaks allocated in the
line with new CEventPair. If I step throught code I do allocation
memory for string. But I dont step into the destructor of the string
down from clear ()
Where is the problem ?
Thanks to all.
Try using autoptr or write a loop in your destructor to clear the memory in
CEventPair etc