Freeing xalloc'ed array
Jonathan Wakely
cow@compsoc.man.ac.uk
Wed Oct 13 11:40:00 GMT 2004
On Wed, Oct 13, 2004 at 11:26:20AM +0200, Paolo Carlini wrote:
> More specifically, there is this comment in ios_base.h that explains why you
> are seeing it (note that you are calling iword on cout, a standard stream):
>
> // Destructor
> /**
> * Invokes each callback with erase_event. Destroys local storage.
> *
> * Note that the ios_base object for the standard streams never gets
> * destroyed. As a result, any callbacks registered with the standard
> * streams will not get invoked with erase_event (unless copyfmt is
> * used).
> */
> virtual ~ios_base();
I'll add that the the FAQ then, IIRC it only specifically says you should
expect to see leaks from the containers, not the standard streams as
well.
> Forgot to add: professional programmer arounds, using gcc + valgrind often
> prepare custom suppression files, in order to avoid spurious entries in the
> valgrind reports (I'm sure they do that at CERN, f.i.)
I'll mention that too.
I've got a few things queued to be changed in the docs. I will get
round to them, I've just been enjoying doing the TR1 stuff more.
jon
--
"A thing is not necessarily true because a man dies for it."
- Oscar Wilde
More information about the Libstdc++
mailing list