summaryrefslogtreecommitdiff
path: root/src/TrackerWatcherCommand.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/TrackerWatcherCommand.cc')
-rw-r--r--src/TrackerWatcherCommand.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/TrackerWatcherCommand.cc b/src/TrackerWatcherCommand.cc
index 09a29bf0..517f13ad 100644
--- a/src/TrackerWatcherCommand.cc
+++ b/src/TrackerWatcherCommand.cc
@@ -104,17 +104,17 @@ bool TrackerWatcherCommand::execute() {
if(_trackerRequestGroup.isNull()) {
_trackerRequestGroup = createAnnounce();
if(!_trackerRequestGroup.isNull()) {
- std::vector<Command*> commands;
try {
- _trackerRequestGroup->createInitialCommand(commands, _e);
+ std::vector<Command*>* commands = new std::vector<Command*>();
+ auto_delete_container<std::vector<Command*> > commandsDel(commands);
+ _trackerRequestGroup->createInitialCommand(*commands, _e);
+ _e->addCommand(*commands);
+ commands->clear();
+ if(getLogger()->debug()) {
+ getLogger()->debug("added tracker request command");
+ }
} catch(RecoverableException& ex) {
getLogger()->error(EX_EXCEPTION_CAUGHT, ex);
- std::for_each(commands.begin(), commands.end(), Deleter());
- commands.clear();
- }
- _e->addCommand(commands);
- if(getLogger()->debug()) {
- getLogger()->debug("added tracker request command");
}
}
} else if(_trackerRequestGroup->downloadFinished()){