fix races in preload

This commit is contained in:
nikk gitanes
2023-04-09 04:46:01 +03:00
parent 42da0ba3d7
commit 2dfa2fe227
2 changed files with 25 additions and 19 deletions

View File

@@ -104,10 +104,9 @@ func (c *Cache) Close() error {
}
}
c.pieces = nil
c.muReaders.Lock()
c.readers = nil
c.pieces = nil
c.muReaders.Unlock()
utils.FreeOSMemGC()