fixed issue with disk read cache not being cleared when removing torrents

This commit is contained in:
Arvid Norberg
2010-02-21 08:52:26 +00:00
parent 17750035ea
commit 59deff7a44
4 changed files with 32 additions and 2 deletions

View File

@@ -1650,6 +1650,25 @@ namespace libtorrent
post_callback(i->second.callback, i->second, -3);
sorted_read_jobs.erase(i++);
}
jl.unlock();
mutex_t::scoped_lock l(m_piece_mutex);
for (cache_t::iterator i = m_read_pieces.begin();
i != m_read_pieces.end();)
{
if (i->storage == j.storage)
{
free_piece(*i, l);
i = m_read_pieces.erase(i);
}
else
{
++i;
}
}
l.unlock();
release_memory();
break;
}
case disk_io_job::abort_thread: