mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
fixed some memory leaks
This commit is contained in:
parent
54e5727670
commit
1d6a85394e
2 changed files with 25 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -175,6 +175,9 @@ contains
|
|||
! Free up space
|
||||
call deallocate_image(img)
|
||||
|
||||
! Clear particle
|
||||
call p % clear()
|
||||
|
||||
end subroutine create_ppm
|
||||
|
||||
!===============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue