Skip to content

Commit

Permalink
Free ESMF.Grid object to prevent small memory leak.
Browse files Browse the repository at this point in the history
Partially address #53.
  • Loading branch information
JiaweiZhuang committed Aug 3, 2019
1 parent 174d043 commit 9963d95
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xesmf/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,15 @@ def esmf_regrid_finalize(regrid):
'''

regrid.destroy()
regrid.srcfield.destroy()
regrid.dstfield.destroy()
regrid.destroy()
regrid.srcfield.grid.destroy()
regrid.dstfield.grid.destroy()

# double check
assert regrid.finalized
assert regrid.srcfield.finalized
assert regrid.dstfield.finalized
assert regrid.finalized
assert regrid.srcfield.grid.finalized
assert regrid.dstfield.grid.finalized

0 comments on commit 9963d95

Please # to comment.