Re: Memory leaks


Subject: Re: Memory leaks
From: Mike Nordell (tamlin@algonet.se)
Date: Tue Jun 19 2001 - 23:46:47 CDT


Martin Sevior wrote:
> On Tue, 19 Jun 2001, Dom Lachowicz wrote:
[...]
> > void foo() {
> > UT_String bar = "hiya";
> > doSomething(bar);
> > // destructor implicity gets called as we leave scope
> > }
> >
>
> I can say that I've experimentally determined that pointers pointing to
> bar.c_str() inside foo , point to garbage outside foo.

I'd bloody hope so! Sorry for the exlamation mark, but _obviously_ it's
pointing to he.. after it has gone out of scope.
You wouldn't try to use an out-of-scope stack variable, would you?! ;->

/Mike



This archive was generated by hypermail 2b25 : Tue Jun 19 2001 - 23:46:25 CDT