mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
release pieces on torrent drop
This commit is contained in:
@@ -90,6 +90,9 @@ func (c *Cache) Piece(m metainfo.Piece) storage.PieceImpl {
|
|||||||
func (c *Cache) Close() error {
|
func (c *Cache) Close() error {
|
||||||
log.TLogln("Close cache for:", c.hash)
|
log.TLogln("Close cache for:", c.hash)
|
||||||
delete(c.storage.caches, c.hash)
|
delete(c.storage.caches, c.hash)
|
||||||
|
for _, v := range c.pieces {
|
||||||
|
v.Release()
|
||||||
|
}
|
||||||
c.pieces = nil
|
c.pieces = nil
|
||||||
|
|
||||||
c.muReaders.Lock()
|
c.muReaders.Lock()
|
||||||
|
|||||||
Reference in New Issue
Block a user