Fixed crash on exit while downloading from webseed (#4451)

This commit is contained in:
Cœur
2022-12-24 01:34:08 +08:00
committed by GitHub
parent 14a3d01e45
commit 3cee8bae36
+3 -3
View File
@@ -452,9 +452,6 @@ void onPartialDataFetched(tr_web::FetchResponse const& web_response)
bool const success = status == 206;
auto* const task = static_cast<tr_webseed_task*>(vtask);
auto* const webseed = task->webseed;
webseed->connection_limiter.taskFinished(success);
if (task->dead)
{
@@ -462,6 +459,9 @@ void onPartialDataFetched(tr_web::FetchResponse const& web_response)
return;
}
auto* const webseed = task->webseed;
webseed->connection_limiter.taskFinished(success);
if (auto const* const tor = webseed->getTorrent(); tor == nullptr)
{
return;