9 Aug
2006
9 Aug
'06
9 a.m.
Mary Huther wrote:
Hi...I need help bad. I just started using boost and it seemed very useful for doing regular expressions. I do have a problem and that is I have tons of memory leaks and I am not sure how or if it can be fixed. I have isolated the leak to the following section of code:
for(iter = mapData.begin(); iter != mapData.end(); iter++) { // MH: Leak here const wchar_t * expressionText = (wchar_t *)(*iter).first.c_str(); const wchar_t * formatText = (wchar_t *)(*iter).second.c_str();
What does mapData contain, those C style casts look suspicious at best. Are you expecting regex to take over ownership of those pointers? As it most certainly does not do that. Apologies for asking the obvious questions. John.