----- Original Message -----
From: "P Suckling" <[log in to unmask]>
To: <[log in to unmask]>
>
> I must admit that from the example code that you gave, I don't fully
understand
> how the memory allocated and never deallocated in the function call is
recovered
> in the main program.
Remember that a reference to a pointer results in an automatic dereference
of its target. Thus, in
pv = elemental_pointer_fun(6)
arr(1) = pv
deallocate (pv%vect) ! memory recovered
one is deallocating the target of pv%vect, namely
"elemental_pointer_fun(6)%vect", (so to speak).
Regards,
Mike
|