Skip to content

Commit 9479e1a

Browse files
committed
Merge branch 'framework/fix_cellLimitField_leak' into develop (PR #1264)
This merge fixes a memory leak in mpas_block_creator_build_cell_halos by deallocating the cellLimitField field before the routine returns. The cellLimitField field 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. * framework/fix_cellLimitField_leak: Fix memory leak from cellLimitField in mpas_block_creator_build_cell_halos
2 parents 4d7cc96 + 90f7ecc commit 9479e1a

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)