Clone set before modifying
This commit is contained in:
@@ -24,12 +24,11 @@ func (t *TorrentManager) Delete(accessKey string, deleteInRD bool) {
|
||||
allTorrents, _ := t.DirectoryMap.Get(INT_ALL)
|
||||
if torrent, ok := allTorrents.Get(accessKey); ok {
|
||||
if deleteInRD {
|
||||
torrent.DownloadedIDs.Each(func(torrentID string) bool {
|
||||
torrent.DownloadedIDs.Clone().Each(func(torrentID string) bool {
|
||||
t.log.Debugf("Deleting torrent %s (id=%s) in RD", accessKey, torrentID)
|
||||
t.api.DeleteTorrent(torrentID)
|
||||
t.deleteInfoFile(torrentID)
|
||||
return false
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user