Break circular references when closing SSLTransport objects (#981)

This commit is contained in:
Michaël Sghaïer 2017-06-09 18:29:46 -04:00 committed by Yury Selivanov
parent a0e3d2dd09
commit d1f575116a
1 changed files with 6 additions and 4 deletions

View File

@ -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()