summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing/process.py
diff options
context:
space:
mode:
authorAntoine Pitrou <pitrou@free.fr>2017-06-28 10:29:08 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-06-28 10:29:08 (GMT)
commit79d37ae979a65ada0b2ac820279ccc3b1cd41ba6 (patch)
treeb1dabd3de47332efda05fa3f45e916b38b396912 /Lib/multiprocessing/process.py
parenta79f8faccf5e26f55e8b9496ad49d2071b5e299c (diff)
downloadcpython-79d37ae979a65ada0b2ac820279ccc3b1cd41ba6.zip
cpython-79d37ae979a65ada0b2ac820279ccc3b1cd41ba6.tar.gz
cpython-79d37ae979a65ada0b2ac820279ccc3b1cd41ba6.tar.bz2
Clear potential ref cycle between Process and Process target (#2470)
* Clear potential ref cycle between Process and Process target Besides Process.join() not being called, this was an indirect cause of bpo-30775. The threading module already does this. * Add issue reference
Diffstat (limited to 'Lib/multiprocessing/process.py')
-rw-r--r--Lib/multiprocessing/process.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py
index 70bb50d..fde97b7 100644
--- a/Lib/multiprocessing/process.py
+++ b/Lib/multiprocessing/process.py
@@ -110,6 +110,9 @@ class BaseProcess(object):
_cleanup()
self._popen = self._Popen(self)
self._sentinel = self._popen.sentinel
+ # Avoid a refcycle if the target function holds an indirect
+ # reference to the process object (see bpo-30775)
+ del self._target, self._args, self._kwargs
_children.add(self)
def terminate(self):