mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-13 12:46:18 +00:00
Make sure we don't access freed memory if a download is erased during the erased event.
This commit is contained in:
@@ -642,6 +642,9 @@ DownloadList::confirm_finished(Download* download) {
|
|||||||
|
|
||||||
DL_TRIGGER_EVENT(download, "event.download.finished");
|
DL_TRIGGER_EVENT(download, "event.download.finished");
|
||||||
|
|
||||||
|
if (find(infohash) != end())
|
||||||
|
return;
|
||||||
|
|
||||||
// if (download->resume_flags() != ~uint32_t())
|
// if (download->resume_flags() != ~uint32_t())
|
||||||
// throw torrent::internal_error("DownloadList::confirm_finished(...) download->resume_flags() != ~uint32_t().");
|
// throw torrent::internal_error("DownloadList::confirm_finished(...) download->resume_flags() != ~uint32_t().");
|
||||||
|
|
||||||
@@ -655,8 +658,7 @@ DownloadList::confirm_finished(Download* download) {
|
|||||||
// being hashed.
|
// being hashed.
|
||||||
download->set_resume_flags(~uint32_t());
|
download->set_resume_flags(~uint32_t());
|
||||||
|
|
||||||
if (find(infohash) != end() &&
|
if (!download->is_active() && rpc::call_command_value("d.state", rpc::make_target(download)) == 1)
|
||||||
!download->is_active() && rpc::call_command_value("d.state", rpc::make_target(download)) == 1)
|
|
||||||
resume(download,
|
resume(download,
|
||||||
torrent::Download::start_no_create |
|
torrent::Download::start_no_create |
|
||||||
torrent::Download::start_skip_tracker |
|
torrent::Download::start_skip_tracker |
|
||||||
|
|||||||
Reference in New Issue
Block a user