Unref open connections in the listener loops to let gc collect when closed

This commit is contained in:
Lee Miller 2024-08-25 15:15:14 +03:00
parent 2193a972ee
commit c0cbac214e
Signed by: lee.miller
GPG Key ID: 4F97A5EA88F4AB63
2 changed files with 2 additions and 0 deletions

View File

@ -49,6 +49,7 @@ class I2PListener(I2PThread):
destination, 'i2p', self.s, 'i2p', True, destination)
c.start()
self.state.connections.add(c)
c = None
self.new_socket()
except socket.timeout:
pass

View File

@ -39,3 +39,4 @@ class Listener(threading.Thread):
c = Connection(*addr[:2], conn, server=True)
c.start()
shared.connections.add(c)
c = None