String and std::string
William A. Hoffman
billlist@nycap.rr.com
Fri Mar 21 13:36:00 GMT 2003
I think you are confusing strstream with string.
With strstream if you call .str(), you must call
delete on the string, or call freeze(0). I have never
seen a problem with g++ and string .c_str() leaking memory.
-Bill
At 08:08 AM 3/21/2003, Pavel Tsekov wrote:
>On 21 Mar 2003, Robert Collins wrote:
>
>> this may well. Look in the g++ library for freeze() (again, IIRC). The
>> thing I saw when I was reading the source, was that the internal buffer
>> was not delete[]'d once it was handed out via c_str(). That was with the
>> libstc++ for gcc 2.95 as well. I've just checked the g++ 3
>> implementation, and it's different to what I recall from before...
>
>gcc 2.95.x has many problems in its standard c++ library
>implementation. I remeber seeing some implementations returning the
>internal pointer directly. I had many problem with iostreams with gcc
>2.95.x - I real nightmare.
More information about the Cygwin-apps
mailing list