Re: Memory leaks


Subject: Re: Memory leaks
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Tue Jun 19 2001 - 23:17:37 CDT


On Tue, 19 Jun 2001, Dom Lachowicz wrote:

> heap). So it's not like we're forgetting to call delete on them... or are we?
> I'm thinking that the destructor should get implicitly called here: Expert
> advice is sought after...
>
> 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 had to move some
UT_String 's to member variables because of this.

Cheers

Martin

Still an Experimental Scientist even while coding :-)



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