Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Memory Leak?

$
0
0

Does the following code cause a memory leak?

type t_A;  integer, allocatable :: i(:);  end type t_A

type(t_A), allocatable :: A(:);  integer :: i

allocate (A(10))

do i = 1, 10;  call S(A(i));  end do

deallocate (A)

...

subroutine S(x);  type(t_A) :: x;  allocate (x%i(3));  end subroutine S

Or, does deallocating the outer array A automatically deallocate the embedded arrays?

 

 


Viewing all articles
Browse latest Browse all 5691


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>