mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-09 10:08:11 -07:00
remove memory explicit deallocation because of race
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user