client_test fix
This commit is contained in:
parent
c0195ae221
commit
09c1e0f007
|
@ -488,16 +488,18 @@ void scan_dir(path const& dir_path
|
||||||
|
|
||||||
// remove the torrents that are no longer in the directory
|
// remove the torrents that are no longer in the directory
|
||||||
|
|
||||||
for (handles_t::iterator i = handles.begin()
|
for (handles_t::iterator i = handles.begin(); !handles.empty() && i != handles.end();)
|
||||||
, end(handles.end()); i != end; ++i)
|
|
||||||
{
|
{
|
||||||
if (i->first.empty()) continue;
|
if (i->first.empty() || valid.find(i->first) != valid.end())
|
||||||
if (valid.find(i->first) != valid.end()) continue;
|
{
|
||||||
|
++i;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
torrent_handle& h = i->second;
|
torrent_handle& h = i->second;
|
||||||
if (!h.is_valid())
|
if (!h.is_valid())
|
||||||
{
|
{
|
||||||
handles.erase(i--);
|
handles.erase(i);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,7 +514,7 @@ void scan_dir(path const& dir_path
|
||||||
bencode(std::ostream_iterator<char>(out), data);
|
bencode(std::ostream_iterator<char>(out), data);
|
||||||
}
|
}
|
||||||
ses.remove_torrent(h);
|
ses.remove_torrent(h);
|
||||||
handles.erase(i--);
|
handles.erase(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue