fix torrent invariant when creating the piece picker fails

This commit is contained in:
arvidn 2017-12-28 15:35:34 +01:00 committed by Arvid Norberg
parent 0eec9194db
commit 6047e42c16
1 changed files with 3 additions and 6 deletions

View File

@ -1234,14 +1234,11 @@ namespace libtorrent {
, blocks_in_last_piece , blocks_in_last_piece
, m_torrent_file->num_pieces())); , m_torrent_file->num_pieces()));
m_picker = std::move(pp);
// initialize the file progress too // initialize the file progress too
if (m_file_progress.empty()) if (m_file_progress.empty())
{ m_file_progress.init(*pp, m_torrent_file->files());
TORRENT_ASSERT(has_picker());
m_file_progress.init(picker(), m_torrent_file->files()); m_picker = std::move(pp);
}
update_gauge(); update_gauge();