This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Memory leak in sstream
- From: Matej Urbas <matej dot urbas at guest dot arnes dot si>
- To: libstdc++ at gcc dot gnu dot org
- Date: Thu, 15 Sep 2005 23:39:35 +0200
- Subject: Memory leak in sstream
Hi
I've recently used the stringstream class in one of my projects in which
I have predefined the global new operator (to search for any memory leaks).
When doing something like this:
stringstream* str = new stringstream;
str.put( 'c' );
delete str;
some memory is allocated by the stringstream class (when put is
processed). However, after the delete call (in the third line), those
memory allocations don't get deallocated by means of the global delete
operator (even though they are created in this fashion) - it seems like
the destructor doesn't do its job (right)...
Is this a memory leak, or is this only a design issue (is the data
deallocated in an other way, an not with the delete operator)?
Please help me with that, please.
Best regards
Matej