summaryrefslogtreecommitdiff
path: root/src/CheckIntegrityCommand.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/CheckIntegrityCommand.cc')
-rw-r--r--src/CheckIntegrityCommand.cc26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/CheckIntegrityCommand.cc b/src/CheckIntegrityCommand.cc
index 262f2626..72087520 100644
--- a/src/CheckIntegrityCommand.cc
+++ b/src/CheckIntegrityCommand.cc
@@ -75,26 +75,20 @@ bool CheckIntegrityCommand::executeInternal()
getLogger()->notice
(MSG_VERIFICATION_SUCCESSFUL,
getRequestGroup()->getDownloadContext()->getBasePath().c_str());
- std::vector<Command*> commands;
- try {
- _entry->onDownloadFinished(commands, getDownloadEngine());
- } catch(RecoverableException& e) {
- std::for_each(commands.begin(), commands.end(), Deleter());
- throw;
- }
- getDownloadEngine()->addCommand(commands);
+ std::vector<Command*>* commands = new std::vector<Command*>();
+ auto_delete_container<std::vector<Command*> > commandsDel(commands);
+ _entry->onDownloadFinished(*commands, getDownloadEngine());
+ getDownloadEngine()->addCommand(*commands);
+ commands->clear();
} else {
getLogger()->error
(MSG_VERIFICATION_FAILED,
getRequestGroup()->getDownloadContext()->getBasePath().c_str());
- std::vector<Command*> commands;
- try {
- _entry->onDownloadIncomplete(commands, getDownloadEngine());
- } catch(RecoverableException& e) {
- std::for_each(commands.begin(), commands.end(), Deleter());
- throw;
- }
- getDownloadEngine()->addCommand(commands);
+ std::vector<Command*>* commands = new std::vector<Command*>();
+ auto_delete_container<std::vector<Command*> > commandsDel(commands);
+ _entry->onDownloadIncomplete(*commands, getDownloadEngine());
+ getDownloadEngine()->addCommand(*commands);
+ commands->clear();
}
getDownloadEngine()->setNoWait(true);
return true;