fix storage tick invariant check failure

This commit is contained in:
arvidn 2017-02-26 17:57:12 -05:00 committed by Arvid Norberg
parent 56925ee8f3
commit 9d645055ff
1 changed files with 7 additions and 4 deletions

View File

@ -10295,11 +10295,14 @@ namespace libtorrent
if (m_storage_tick > 0 && is_loaded())
{
--m_storage_tick;
if (m_storage_tick == 0 && m_storage)
if (m_storage_tick == 0)
{
m_ses.disk_thread().async_tick_torrent(&storage()
, boost::bind(&torrent::on_disk_tick_done
, shared_from_this(), _1));
if (m_storage)
{
m_ses.disk_thread().async_tick_torrent(&storage()
, boost::bind(&torrent::on_disk_tick_done
, shared_from_this(), _1));
}
update_want_tick();
}
}