diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-23 21:55:52 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-23 21:55:52 +0900 |
| commit | fa9f3fb5a3c8912a0a6880ffba9c72f4424ea044 (patch) | |
| tree | deb0b47b085a3a689bf386409734bfd3f72f57d2 /src/FileAllocationDispatcherCommand.cc | |
| parent | bb5b7eeedb3ce7396007818cbab4f5f5660997a5 (diff) | |
Wrap Command object in std::unique_ptr
Diffstat (limited to 'src/FileAllocationDispatcherCommand.cc')
| -rw-r--r-- | src/FileAllocationDispatcherCommand.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/FileAllocationDispatcherCommand.cc b/src/FileAllocationDispatcherCommand.cc index 70e6573a..4a56b569 100644 --- a/src/FileAllocationDispatcherCommand.cc +++ b/src/FileAllocationDispatcherCommand.cc @@ -50,15 +50,13 @@ FileAllocationDispatcherCommand::FileAllocationDispatcherCommand : SequentialDispatcherCommand<FileAllocationEntry>(cuid, fileAllocMan, e) {} -Command* FileAllocationDispatcherCommand::createCommand +std::unique_ptr<Command> FileAllocationDispatcherCommand::createCommand (const std::shared_ptr<FileAllocationEntry>& entry) { cuid_t newCUID = getDownloadEngine()->newCUID(); A2_LOG_INFO(fmt(MSG_FILE_ALLOCATION_DISPATCH, newCUID)); - FileAllocationCommand* command = - new FileAllocationCommand(newCUID, entry->getRequestGroup(), - getDownloadEngine(), entry); - return command; + return make_unique<FileAllocationCommand> + (newCUID, entry->getRequestGroup(), getDownloadEngine(), entry); } } // namespace aria2 |
