mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-20 08:06:18 +00:00
Properly clear out download list before calling torrent::cleanup().
This commit is contained in:
@@ -43,10 +43,14 @@ DownloadList::check_contains([[maybe_unused]] Download* d) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
DownloadList::clear() {
|
DownloadList::clear() {
|
||||||
std::for_each(begin(), end(), [&](Download* d) { close(d); });
|
while (!empty()) {
|
||||||
std::for_each(begin(), end(), [](Download* d) { delete d; });
|
auto download = back();
|
||||||
|
base_type::pop_back();
|
||||||
|
|
||||||
base_type::clear();
|
close(download);
|
||||||
|
torrent::download_remove(*download->download());
|
||||||
|
delete download;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user