Commit 87a40c73 authored by Jason Madden's avatar Jason Madden

Don't ref the implicit child watchers unless explicitly asked for; they...

Don't ref the implicit child watchers unless explicitly asked for; they shouldn't keep the loop alive since the user didn't ask for them
parent e0d9b60a
......@@ -165,7 +165,7 @@ if hasattr(os, 'fork'):
# we're not watching it
return _waitpid(pid, options)
def fork_and_watch(callback=None, loop=None, fork=fork):
def fork_and_watch(callback=None, loop=None, ref=False, fork=fork):
"""
Fork a child process and start a child watcher for it in the parent process.
......
......@@ -935,7 +935,7 @@ class Popen(object):
# write to stderr -> hang. http://bugs.python.org/issue1336
gc.disable()
try:
self.pid = fork_and_watch(self._on_child, self._loop, fork)
self.pid = fork_and_watch(self._on_child, self._loop, True, fork)
except:
if gc_was_enabled:
gc.enable()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment