Hi everyone!
I have a question concerning deallocation of an abstract data types (ADT's)
containing pointer components. Let us say I have a situation as follows:
TYPE :: ExType
CHARACTER(LEN=10) :: Name
REAL, POINTER :: Data(:)
END TYPE ExType
TYPE(ExType), POINTER :: InsType
ALLOCATE( InsType )
ALLOCATE( InsType%Data(100) )
Some code ....
DEALLOCATE( InsType )
My question is as follows: Will the DEALLOCATE statement above also
automatically deallocate the pointer component Data in a way not leading to
memory leaks? Or do I have to take care of this explicitly myself by
issuing the following sequence of commands instad:
DEALLOCATE( InsType%Data )
DEALLOCATE( InsType )
Thanks in advance for a reply!
Magne Rudshaug, Institute for Energy Technology (IFE)
Address: Postboks 40, 2007 Kjeller, Norway
E-Mail: [log in to unmask]
Phone: (+47)63806165
Fax: (+47)63811168
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|