From fa9f3fb5a3c8912a0a6880ffba9c72f4424ea044 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 23 Jun 2013 21:55:52 +0900 Subject: Wrap Command object in std::unique_ptr --- src/FileAllocationCommand.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/FileAllocationCommand.cc') diff --git a/src/FileAllocationCommand.cc b/src/FileAllocationCommand.cc index 54c4e7a5..b76357cc 100644 --- a/src/FileAllocationCommand.cc +++ b/src/FileAllocationCommand.cc @@ -74,15 +74,13 @@ bool FileAllocationCommand::executeInternal() getRequestGroup()->getTotalLength())); getDownloadEngine()->getFileAllocationMan()->dropPickedEntry(); - std::vector* commands = new std::vector(); - auto_delete_container > commandsDel(commands); - fileAllocationEntry_->prepareForNextAction(*commands, getDownloadEngine()); - getDownloadEngine()->addCommand(*commands); - commands->clear(); + std::vector> commands; + fileAllocationEntry_->prepareForNextAction(commands, getDownloadEngine()); + getDownloadEngine()->addCommand(std::move(commands)); getDownloadEngine()->setNoWait(true); return true; } else { - getDownloadEngine()->addCommand(this); + getDownloadEngine()->addCommand(std::unique_ptr(this)); return false; } } -- cgit