This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/10276: memory leak for stringstream / ios_base callback cache.
- From: carlo at alinoe dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 31 Mar 2003 12:36:03 -0000
- Subject: libstdc++/10276: memory leak for stringstream / ios_base callback cache.
- Reply-to: carlo at alinoe dot com
>Number: 10276
>Category: libstdc++
>Synopsis: memory leak for stringstream / ios_base callback cache.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Mar 31 12:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Carlo Wood
>Release: 3.3 branch
>Organization:
>Environment:
i686-gnu-linux
>Description:
The following code snippet leaks memory:
for (int i = 0; i < 1000; ++i)
{
std::ostringstream s;
}
this results in 1000 undeleted allocations that made
with 'new' in respectively ios.cc and basic_ios.tcc
at:
ios.cc:
void
ios_base::register_callback(event_callback __fn, int __index)
{ _M_callbacks = new _Callback_list(__fn, __index, _M_callbacks); }
and
bits/basic_ios.tcc:
if (!pword(0)) {
pword(0) = auto_ptr<__cache_t>(new __cache_t()).release();
register_callback(__cache_t::_S_callback, 0);
}
Can someone please make this high priority?
Its a regression and I really think that it
MUST be fixed before 3.3 is released.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: