remove memory explicit deallocation because of race

This commit is contained in:
Lawrence, Rendall
2022-11-30 18:17:12 +03:00
parent 3b1b74ad4f
commit a69a476024
-7
View File
@@ -570,13 +570,6 @@ func (ps *peerStore) Close() error {
ps.onceCloser.Do(func() {
close(ps.closed)
ps.wg.Wait()
// Explicitly deallocate our storage.
shards := make([]*peerShard, len(ps.shards))
for i := 0; i < len(ps.shards); i++ {
shards[i] = &peerShard{swarms: &ihSwarm{m: make(map[bittorrent.InfoHash]swarm)}}
}
ps.shards = shards
})
return nil