| Re: pointer components and memory leaks |
|
 |
|
 |
|
 |
|
 |
Group: comp.lang.fortran · Group Profile
Author: Paul van DelstPaul van Delst Date: Sep 16, 2008 13:19
Richard Maine wrote:
> rusi_pathan gmail.com> wrote:
>
>> Correct me if I am wrong but isnt 'z%%x' in tt_sum being lost here?
>
> Yes, that's the same thing as what Paul said. Perhaps you are looking at
> the variable from different perspectives. It is "created" as the z in
> tt_sum and then used as the x in tt_def that Paul mentioned. But its the
> same thing.
>
>> Also isnt this more like a compiler bug?
>
> Let's not suggest compiler bug every time one finds a problem.
I agree (i.e. it's not a compiler bug). To be honest, the behaviour seems quite reasonable.
Annoyingly leaky, perhaps, but reasonable.
It's got me beat to figure out how to make it *not* leak - how to deallocate the temporary
result of a+b?
A very illuminating example. It's getting copied into my examples folder (uh, er, I mean
"directory" :o)
cheers,
paulv
|