From 9d645055ff9ee28833f3309e3ef68519734e8e57 Mon Sep 17 00:00:00 2001 From: arvidn Date: Sun, 26 Feb 2017 17:57:12 -0500 Subject: [PATCH] fix storage tick invariant check failure --- src/torrent.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index 56109e1af..de58f8e28 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -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(); } }