mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
Interrupt verification ASAP if torrent is being removed
This commit is contained in:
@@ -1773,6 +1773,9 @@ onVerifyDoneThreadFunc (void * vdata)
|
|||||||
struct verify_data * data = vdata;
|
struct verify_data * data = vdata;
|
||||||
tr_torrent * tor = data->tor;
|
tr_torrent * tor = data->tor;
|
||||||
|
|
||||||
|
if (tor->isDeleting)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
if (!data->aborted)
|
if (!data->aborted)
|
||||||
tr_torrentRecheckCompleteness (tor);
|
tr_torrentRecheckCompleteness (tor);
|
||||||
|
|
||||||
@@ -1785,6 +1788,7 @@ onVerifyDoneThreadFunc (void * vdata)
|
|||||||
torrentStart (tor, false);
|
torrentStart (tor, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cleanup:
|
||||||
tr_free (data);
|
tr_free (data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1793,6 +1797,13 @@ onVerifyDone (tr_torrent * tor, bool aborted, void * vdata)
|
|||||||
{
|
{
|
||||||
struct verify_data * data = vdata;
|
struct verify_data * data = vdata;
|
||||||
assert (data->tor == tor);
|
assert (data->tor == tor);
|
||||||
|
|
||||||
|
if (tor->isDeleting)
|
||||||
|
{
|
||||||
|
tr_free (data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
data->aborted = aborted;
|
data->aborted = aborted;
|
||||||
tr_runInEventThread (tor->session, onVerifyDoneThreadFunc, data);
|
tr_runInEventThread (tor->session, onVerifyDoneThreadFunc, data);
|
||||||
}
|
}
|
||||||
@@ -1805,6 +1816,12 @@ verifyTorrent (void * vdata)
|
|||||||
tr_torrent * tor = data->tor;
|
tr_torrent * tor = data->tor;
|
||||||
tr_sessionLock (tor->session);
|
tr_sessionLock (tor->session);
|
||||||
|
|
||||||
|
if (tor->isDeleting)
|
||||||
|
{
|
||||||
|
tr_free (data);
|
||||||
|
goto unlock;
|
||||||
|
}
|
||||||
|
|
||||||
/* if the torrent's already being verified, stop it */
|
/* if the torrent's already being verified, stop it */
|
||||||
tr_verifyRemove (tor);
|
tr_verifyRemove (tor);
|
||||||
|
|
||||||
@@ -1818,6 +1835,7 @@ verifyTorrent (void * vdata)
|
|||||||
else
|
else
|
||||||
tr_verifyAdd (tor, onVerifyDone, data);
|
tr_verifyAdd (tor, onVerifyDone, data);
|
||||||
|
|
||||||
|
unlock:
|
||||||
tr_sessionUnlock (tor->session);
|
tr_sessionUnlock (tor->session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user