fix lt assert

This commit is contained in:
Marcos Pinto 2007-12-14 08:44:31 +00:00
parent 8821113742
commit c8507b4c28
2 changed files with 14 additions and 1 deletions

View File

@ -780,6 +780,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<boost::shared_ptr<torrent_plugin> > extension_list_t;
extension_list_t m_extensions;

View File

@ -204,6 +204,9 @@ namespace libtorrent
, m_max_connections((std::numeric_limits<int>::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<int>::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);