fix for when removing a torrent when it is in the checking state

This commit is contained in:
Arvid Norberg 2008-10-26 09:23:00 +00:00
parent 8f7a3ddfe0
commit 65c4b7ec13
2 changed files with 6 additions and 3 deletions

View File

@ -1891,7 +1891,7 @@ namespace aux {
#ifndef NDEBUG
sha1_hash i_hash = t.torrent_file().info_hash();
#endif
i->second->set_queue_position(-1);
t.set_queue_position(-1);
m_torrents.erase(i);
std::list<boost::shared_ptr<torrent> >::iterator k
= std::find(m_queued_for_checking.begin(), m_queued_for_checking.end(), tptr);

View File

@ -784,7 +784,7 @@ namespace libtorrent
// we're done, or encounter a failure
if (ret == piece_manager::need_full_check) return;
m_ses.done_checking(shared_from_this());
if (!m_abort) m_ses.done_checking(shared_from_this());
files_checked();
}
@ -1624,7 +1624,10 @@ namespace libtorrent
if (m_owning_storage.get())
m_storage->async_release_files(
bind(&torrent::on_files_released, shared_from_this(), _1, _2));
if (m_state == torrent_status::checking_files)
m_ses.done_checking(shared_from_this());
m_owning_storage = 0;
m_host_resolver.cancel();
}