diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 56f40dd7f..92b19b18f 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -3321,8 +3321,8 @@ retry: num_downloads_peers += t.num_peers(); } - t.second_tick(m_stat, tick_interval_ms); ++i; + t.second_tick(m_stat, tick_interval_ms); } // some people claim that there sometimes can be cases where diff --git a/src/torrent.cpp b/src/torrent.cpp index fc8633167..cce09648f 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -7671,6 +7671,8 @@ namespace libtorrent TORRENT_ASSERT(m_ses.is_network_thread()); INVARIANT_CHECK; + boost::weak_ptr self(shared_from_this()); + #ifndef TORRENT_DISABLE_EXTENSIONS for (extension_list_t::iterator i = m_extensions.begin() , end(m_extensions.end()); i != end; ++i) @@ -7679,6 +7681,8 @@ namespace libtorrent (*i)->tick(); } TORRENT_CATCH (std::exception&) {} } + + if (m_abort) return; #endif m_time_scaler--;