holepunchto / hyperswarm

A distributed networking stack for connecting peers.
https://docs.holepunch.to
MIT License
1.04k stars 84 forks source link

PeerDiscovery._destroyMaybe calls this.swarm.leave #122

Closed andrewosh closed 1 year ago

andrewosh commented 1 year ago

Closing the last remaining PeerDiscoverySession for a topic will currently not delete the PeerDiscovery object from the swarm._discovery Map. If PeerDiscovery.destroy is always called through Hyperswarm.leave, then all discovery objects will be fully GC'd on leave.