From e9fd283aedf54e2effc73f4157524fe9a26993c0 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 16 Oct 2012 08:55:22 -0700 Subject: run_action: gc locals of calling func --- pym/_emerge/actions.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'pym/_emerge/actions.py') diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 3336e9fca..c403d8974 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -3426,7 +3426,14 @@ def repo_name_duplicate_check(trees): return bool(ignored_repos) -def run_action(settings, trees, mtimedb, myaction, myopts, myfiles): +def run_action(settings, trees, mtimedb, myaction, myopts, myfiles, + gc_locals=None): + + # The caller may have its local variables garbage collected, so + # they don't consume any memory during this long-running function. + if gc_locals is not None: + gc_locals() + gc_locals = None # skip global updates prior to sync, since it's called after sync if myaction not in ('help', 'info', 'sync', 'version') and \ -- cgit v1.2.3-1-g7c22