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

Merged
lee.miller merged 2 commits from lee.miller/MiNode:memory into v0.3 2024-10-23 00:36:08 +02:00
2 changed files with 2 additions and 0 deletions
Showing only changes of commit 9bb3038547 - Show all commits

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