|
Boost Users : |
From: John Maddock (john_at_[hidden])
Date: 2006-08-09 05:00:29
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.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net