Skip to content

Commit

Permalink
del model in map_function
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Aug 7, 2024
1 parent fc937a2 commit 1a4a696
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/stpipe/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,9 @@ def map_function(self, function, modify=True):
# this is in a finally to allow cleanup if the generator is
# deleted after it finishes (when it's not fully consumed)
self.shelve(model, index, modify)
# remove the local reference to model here to allow it
# to be garbage collected before the next model is generated
del model

def _model_to_filename(self, model):
"""
Expand Down

0 comments on commit 1a4a696

Please sign in to comment.