assert fix

This commit is contained in:
Arvid Norberg 2007-12-14 06:09:44 +00:00
parent 3945aea772
commit 948f53a8af
2 changed files with 14 additions and 1 deletions

View File

@ -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<boost::shared_ptr<torrent_plugin> > extension_list_t;

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);