packetizer doesn't need a __del__, and the keepalive should use a weakref
This commit is contained in:
parent
07dfbd5808
commit
12efdd7ca1
|
@ -99,13 +99,6 @@ class Packetizer (object):
|
|||
self.__keepalive_last = time.time()
|
||||
self.__keepalive_callback = None
|
||||
|
||||
def __del__(self):
|
||||
# this is not guaranteed to be called, but we should try.
|
||||
try:
|
||||
self.__socket.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
def set_log(self, log):
|
||||
"""
|
||||
Set the python log object to use for logging.
|
||||
|
|
|
@ -727,7 +727,7 @@ class Transport (threading.Thread):
|
|||
@since: fearow
|
||||
"""
|
||||
self.packetizer.set_keepalive(interval,
|
||||
lambda x=self: x.global_request('keepalive@lag.net', wait=False))
|
||||
lambda x=weakref.proxy(self): x.global_request('keepalive@lag.net', wait=False))
|
||||
|
||||
def global_request(self, kind, data=None, wait=True):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue