fix recent regression causing potential duplicate add_torrent_alerts

This commit is contained in:
arvidn 2016-11-12 01:03:38 -05:00
parent e447a50c9d
commit bba121d010
1 changed files with 3 additions and 5 deletions

View File

@ -4535,17 +4535,15 @@ namespace aux {
void session_impl::on_async_load_torrent(add_torrent_params* params, error_code ec)
{
std::unique_ptr<add_torrent_params> holder(params);
if (!ec)
{
add_torrent(*params, ec);
params->url.clear();
}
if (ec)
{
m_alerts.emplace_alert<add_torrent_alert>(torrent_handle()
, *params, ec);
return;
}
add_torrent(*params, ec);
params->url.clear();
}
#ifndef TORRENT_DISABLE_EXTENSIONS