]> granicus.if.org Git - python/commitdiff
Issue #23209: Break some reference cycles in asyncio. Patch written by Martin
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 9 Jan 2015 20:34:27 +0000 (21:34 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Fri, 9 Jan 2015 20:34:27 +0000 (21:34 +0100)
Richard.

Lib/asyncio/base_subprocess.py
Lib/asyncio/futures.py
Lib/selectors.py

index 81698b09850d106ff0cb8d3a46e3c6d3b9ec502a..afc434defa2cef120b15ee4a0d9f95c1a643af68 100644 (file)
@@ -182,6 +182,7 @@ class WriteSubprocessPipeProto(protocols.BaseProtocol):
     def connection_lost(self, exc):
         self.disconnected = True
         self.proc._pipe_connection_lost(self.fd, exc)
+        self.proc = None
 
     def pause_writing(self):
         self.proc._protocol.pause_writing()
index e0e12f0579b23caf4db1b5f25f040c55cc08ed13..19212a94b9f9822d12af2552dedface73d6b7088 100644 (file)
@@ -405,5 +405,5 @@ def wrap_future(fut, *, loop=None):
     new_future.add_done_callback(_check_cancel_other)
     fut.add_done_callback(
         lambda future: loop.call_soon_threadsafe(
-            new_future._copy_state, fut))
+            new_future._copy_state, future))
     return new_future
index e4ad4cb18c4a593f2cee66fd36fa9c83f7de04a4..b2f4c2bad22707ad66152c3868413af0073cff3d 100644 (file)
@@ -256,6 +256,7 @@ class _BaseSelectorImpl(BaseSelector):
 
     def close(self):
         self._fd_to_key.clear()
+        self._map = None
 
     def get_map(self):
         return self._map