From 6b973747f3c5e31afd89f6a7d79bc9f3f1628710 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sat, 3 Nov 2012 15:36:01 +0200 Subject: Issue #16284: Prevent keeping unnecessary references to worker functions in concurrent.futures ThreadPoolExecutor. --- Lib/concurrent/futures/thread.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Lib/concurrent/futures/thread.py') diff --git a/Lib/concurrent/futures/thread.py b/Lib/concurrent/futures/thread.py index 95bb682565..f9beb0f7f7 100644 --- a/Lib/concurrent/futures/thread.py +++ b/Lib/concurrent/futures/thread.py @@ -63,6 +63,8 @@ def _worker(executor_reference, work_queue): work_item = work_queue.get(block=True) if work_item is not None: work_item.run() + # Delete references to object. See issue16284 + del work_item continue executor = executor_reference() # Exit if: -- cgit v1.2.1