mirror of https://github.com/aria2/aria2
Release elements in routineCommands_ on destruction
parent
cef6db17ba
commit
fc0982587b
|
@ -107,18 +107,21 @@ DownloadEngine::DownloadEngine(const SharedHandle<EventPoll>& eventPoll)
|
|||
sessionId_.assign(&sessionId[0], & sessionId[sizeof(sessionId)]);
|
||||
}
|
||||
|
||||
namespace {
|
||||
void cleanQueue(std::deque<Command*>& commands) {
|
||||
std::for_each(commands.begin(), commands.end(), Deleter());
|
||||
commands.clear();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
DownloadEngine::~DownloadEngine() {
|
||||
cleanQueue();
|
||||
cleanQueue(commands_);
|
||||
cleanQueue(routineCommands_);
|
||||
#ifdef HAVE_ARES_ADDR_NODE
|
||||
setAsyncDNSServers(0);
|
||||
#endif // HAVE_ARES_ADDR_NODE
|
||||
}
|
||||
|
||||
void DownloadEngine::cleanQueue() {
|
||||
std::for_each(commands_.begin(), commands_.end(), Deleter());
|
||||
commands_.clear();
|
||||
}
|
||||
|
||||
namespace {
|
||||
void executeCommand(std::deque<Command*>& commands,
|
||||
Command::STATUS statusFilter)
|
||||
|
|
|
@ -183,8 +183,6 @@ public:
|
|||
// processed. Otherwise, returns 0.
|
||||
int run(bool oneshot=false);
|
||||
|
||||
void cleanQueue();
|
||||
|
||||
bool addSocketForReadCheck(const SharedHandle<SocketCore>& socket,
|
||||
Command* command);
|
||||
bool deleteSocketForReadCheck(const SharedHandle<SocketCore>& socket,
|
||||
|
|
Loading…
Reference in New Issue