diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-06 00:17:44 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-06 15:56:08 +0900 |
| commit | 6b397c812520016f7b2b22544f51bfddbcca8dfe (patch) | |
| tree | 6dcf656fb19da47833324111efcee62c66809365 /src/CheckIntegrityCommand.cc | |
| parent | c9e58779e1a30b32ea2f86e686211d901aca19f0 (diff) | |
Use std::unique_ptr for CheckIntegrityEntry and FileAllocationEntry
Diffstat (limited to 'src/CheckIntegrityCommand.cc')
| -rw-r--r-- | src/CheckIntegrityCommand.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/CheckIntegrityCommand.cc b/src/CheckIntegrityCommand.cc index ddc9b59f..4e0557fb 100644 --- a/src/CheckIntegrityCommand.cc +++ b/src/CheckIntegrityCommand.cc @@ -50,22 +50,23 @@ namespace aria2 { CheckIntegrityCommand::CheckIntegrityCommand (cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, - const std::shared_ptr<CheckIntegrityEntry>& entry): - RealtimeCommand(cuid, requestGroup, e), - entry_(entry) + CheckIntegrityEntry* entry) + : RealtimeCommand{cuid, requestGroup, e}, + entry_{entry} {} -CheckIntegrityCommand::~CheckIntegrityCommand() {} +CheckIntegrityCommand::~CheckIntegrityCommand() +{ + getDownloadEngine()->getCheckIntegrityMan()->dropPickedEntry(); +} bool CheckIntegrityCommand::executeInternal() { if(getRequestGroup()->isHaltRequested()) { - getDownloadEngine()->getCheckIntegrityMan()->dropPickedEntry(); return true; } entry_->validateChunk(); if(entry_->finished()) { - getDownloadEngine()->getCheckIntegrityMan()->dropPickedEntry(); // Enable control file saving here. See also // RequestGroup::processCheckIntegrityEntry() to know why this is // needed. @@ -95,7 +96,6 @@ bool CheckIntegrityCommand::executeInternal() bool CheckIntegrityCommand::handleException(Exception& e) { - getDownloadEngine()->getCheckIntegrityMan()->dropPickedEntry(); A2_LOG_ERROR_EX(fmt(MSG_FILE_VALIDATION_FAILURE, getCuid()), e); |
