From c8507b4c2803ff07731d45d4714266593588388b Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Fri, 14 Dec 2007 08:44:31 +0000 Subject: [PATCH] fix lt assert --- libtorrent/include/libtorrent/torrent.hpp | 4 ++++ libtorrent/src/torrent.cpp | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libtorrent/include/libtorrent/torrent.hpp b/libtorrent/include/libtorrent/torrent.hpp index 0f508e93f..4731da6b2 100755 --- a/libtorrent/include/libtorrent/torrent.hpp +++ b/libtorrent/include/libtorrent/torrent.hpp @@ -779,6 +779,10 @@ namespace libtorrent // the maximum number of connections for this torrent int m_max_connections; + +#ifndef NDEBUG + bool m_files_checked; +#endif #ifndef TORRENT_DISABLE_EXTENSIONS typedef std::list > extension_list_t; diff --git a/libtorrent/src/torrent.cpp b/libtorrent/src/torrent.cpp index 557289d60..e8c1f2247 100755 --- a/libtorrent/src/torrent.cpp +++ b/libtorrent/src/torrent.cpp @@ -204,6 +204,9 @@ namespace libtorrent , m_max_connections((std::numeric_limits::max)()) , m_policy(this) { +#ifndef NDEBUG + m_files_checked = false; +#endif } torrent::torrent( @@ -263,6 +266,9 @@ namespace libtorrent , m_max_connections((std::numeric_limits::max)()) , m_policy(this) { +#ifndef NDEBUG + m_files_checked = false; +#endif INVARIANT_CHECK; if (name) m_name.reset(new std::string(name)); @@ -2521,6 +2527,9 @@ namespace libtorrent } } } +#ifndef NDEBUG + m_files_checked = true; +#endif } alert_manager& torrent::alerts() const @@ -2658,7 +2667,7 @@ namespace libtorrent complete = false; break; } - if (complete) + if (complete && m_files_checked) { disk_io_job ret = m_ses.m_disk_thread.find_job( m_owning_storage, -1, i->index);