From d1f575116ae5040ce36ca6097be2ab5dab8e4f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Sgha=C3=AFer?= Date: Fri, 9 Jun 2017 18:29:46 -0400 Subject: Break circular references when closing SSLTransport objects (#981) --- Lib/asyncio/sslproto.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index a7f1e61..68499e5 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -681,12 +681,14 @@ class SSLProtocol(protocols.Protocol): self._transport._force_close(exc) def _finalize(self): + self._sslpipe = None + if self._transport is not None: self._transport.close() def _abort(self): - if self._transport is not None: - try: + try: + if self._transport is not None: self._transport.abort() - finally: - self._finalize() + finally: + self._finalize() -- cgit v0.12