Re: Visual C++ Language stringstream causes memory link VC++ 2005?
mike_n
It looks like you're right..
From what I traced, the basic_iostream inherits from both basic_ostream and basic_istream - both of which virtually inherit from std::basic_ios, which inherits from ios_base. In ios_base::_Init(), the first line is _Ploc = 0;, and the last line is _Ploc = _NEW_CRT locale; (this is in the file xiosbase ) - well, since _Init() gets called for basic_ostream AND basic_istream, that _Ploc pointer is shared, and gets overwritten (with the _Ploc=0 line), and assigned a new locale object - now this is SUPPOSED to be the same "global_locale" object, but it's not - it gets assigned a new locale object, and I think the original object never gets its reference count decremented, so it never gets freed...