Skip to content

Commit 2384910

Browse files
committed
Fix memory leak from cellLimitField in mpas_block_creator_build_cell_halos
The cellLimitField is allocated in the mpas_block_creator_build_cell_halos routine and is only used in a call therein to mpas_dmpar_get_exch_list. If not deallocated at the end of the mpas_block_creator_build_cell_halos routine, the memory allocated to cellLimitField would be otherwise be leaked, since there is nothing outisde of the mpas_block_creator_build_cell_halos routine that retains a reference to it and deallocates it. This commit fixes this memory leak by deallocating cellLimitField before the mpas_block_creator_build_cell_halos routine returns.
1 parent 942d402 commit 2384910

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/framework/mpas_block_creator.F

+1
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@ subroutine mpas_block_creator_build_cell_halos(nHalos, indexToCellID, nEdgesOnCe
715715
! Deallocate array and field.
716716
deallocate(sendingHaloLayers)
717717
call mpas_deallocate_field(offSetField)
718+
call mpas_deallocate_field(cellLimitField)
718719

719720
end subroutine mpas_block_creator_build_cell_halos!}}}
720721

0 commit comments

Comments
 (0)