From a69a47602450c323d015964b96e77da139d0af70 Mon Sep 17 00:00:00 2001 From: "Lawrence, Rendall" Date: Wed, 30 Nov 2022 18:17:12 +0300 Subject: [PATCH] remove `memory` explicit deallocation because of race --- storage/memory/storage.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/storage/memory/storage.go b/storage/memory/storage.go index c6da56d..be27b4c 100644 --- a/storage/memory/storage.go +++ b/storage/memory/storage.go @@ -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