fix recent regression causing potential duplicate add_torrent_alerts
This commit is contained in:
parent
e447a50c9d
commit
bba121d010
|
@ -4535,17 +4535,15 @@ namespace aux {
|
||||||
void session_impl::on_async_load_torrent(add_torrent_params* params, error_code ec)
|
void session_impl::on_async_load_torrent(add_torrent_params* params, error_code ec)
|
||||||
{
|
{
|
||||||
std::unique_ptr<add_torrent_params> holder(params);
|
std::unique_ptr<add_torrent_params> holder(params);
|
||||||
if (!ec)
|
|
||||||
{
|
|
||||||
add_torrent(*params, ec);
|
|
||||||
params->url.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ec)
|
if (ec)
|
||||||
{
|
{
|
||||||
m_alerts.emplace_alert<add_torrent_alert>(torrent_handle()
|
m_alerts.emplace_alert<add_torrent_alert>(torrent_handle()
|
||||||
, *params, ec);
|
, *params, ec);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
add_torrent(*params, ec);
|
||||||
|
params->url.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
|
|
Loading…
Reference in New Issue