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/RpcMethodImpl.cc | |
| parent | bb5b7eeedb3ce7396007818cbab4f5f5660997a5 (diff) | |
Wrap Command object in std::unique_ptr
Diffstat (limited to 'src/RpcMethodImpl.cc')
| -rw-r--r-- | src/RpcMethodImpl.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/RpcMethodImpl.cc b/src/RpcMethodImpl.cc index ddbb8435..d64c6473 100644 --- a/src/RpcMethodImpl.cc +++ b/src/RpcMethodImpl.cc @@ -1312,9 +1312,9 @@ std::shared_ptr<ValueBase> ChangeUriRpcMethod::process } } if(addcount && group->getPieceStorage()) { - std::vector<Command*> commands; + std::vector<std::unique_ptr<Command>> commands; group->createNextCommand(commands, e); - e->addCommand(commands); + e->addCommand(std::move(commands)); group->getSegmentMan()->recognizeSegmentFor(s); } std::shared_ptr<List> res = List::g(); @@ -1329,7 +1329,8 @@ std::shared_ptr<ValueBase> goingShutdown { // Schedule shutdown after 3seconds to give time to client to // receive RPC response. - e->addRoutineCommand(new TimedHaltCommand(e->newCUID(), e, 3, forceHalt)); + e->addRoutineCommand(make_unique<TimedHaltCommand> + (e->newCUID(), e, 3, forceHalt)); A2_LOG_INFO("Scheduled shutdown in 3 seconds."); return VLB_OK; } |
