doing a close() on Transport.__del__ is useless: because a Transport can't go away until all its Channels are collected, it will never make a difference. so don't do it, cuz __del__ is pretty hairy.
This commit is contained in:
parent
27ccd56af7
commit
07dfbd5808
|
@ -298,9 +298,6 @@ class Transport (threading.Thread):
|
||||||
self.server_accept_cv = threading.Condition(self.lock)
|
self.server_accept_cv = threading.Condition(self.lock)
|
||||||
self.subsystem_table = { }
|
self.subsystem_table = { }
|
||||||
|
|
||||||
def __del__(self):
|
|
||||||
self.close()
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""
|
"""
|
||||||
Returns a string representation of this object, for debugging.
|
Returns a string representation of this object, for debugging.
|
||||||
|
@ -551,13 +548,9 @@ class Transport (threading.Thread):
|
||||||
Close this session, and any open channels that are tied to it.
|
Close this session, and any open channels that are tied to it.
|
||||||
"""
|
"""
|
||||||
self.active = False
|
self.active = False
|
||||||
# since this may be called from __del__, can't assume any attributes exist
|
|
||||||
try:
|
|
||||||
self.packetizer.close()
|
self.packetizer.close()
|
||||||
for chan in self.channels.values():
|
for chan in self.channels.values():
|
||||||
chan._unlink()
|
chan._unlink()
|
||||||
except AttributeError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def get_remote_server_key(self):
|
def get_remote_server_key(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue