fixed some memory leaks

This commit is contained in:
Bryan Herman 2014-05-07 18:17:28 -04:00
parent 54e5727670
commit 1d6a85394e
2 changed files with 25 additions and 1 deletions

View file

@ -481,8 +481,29 @@ contains
call sab_dict % clear()
call xs_listing_dict % clear()
! Clear statepoint batch set
! Clear statepoint and sourcepoint batch set
call statepoint_batch % clear()
call sourcepoint_batch % clear()
! Deallocate entropy mesh
if (associated(entropy_mesh)) then
if (allocated(entropy_mesh % lower_left)) &
deallocate(entropy_mesh % lower_left)
if (allocated(entropy_mesh % upper_right)) &
deallocate(entropy_mesh % upper_right)
if (allocated(entropy_mesh % width)) deallocate(entropy_mesh % width)
deallocate(entropy_mesh)
end if
! Deallocate ufs
if (allocated(source_frac)) deallocate(source_frac)
if (associated(ufs_mesh)) then
if (allocated(ufs_mesh % lower_left)) deallocate(ufs_mesh % lower_left)
if (allocated(ufs_mesh % upper_right)) &
deallocate(ufs_mesh % upper_right)
if (allocated(ufs_mesh % width)) deallocate(ufs_mesh % width)
deallocate(ufs_mesh)
end if
end subroutine free_memory

View file

@ -175,6 +175,9 @@ contains
! Free up space
call deallocate_image(img)
! Clear particle
call p % clear()
end subroutine create_ppm
!===============================================================================