summaryrefslogtreecommitdiff
path: root/src/CheckIntegrityCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-06 00:17:44 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-06 15:56:08 +0900
commit6b397c812520016f7b2b22544f51bfddbcca8dfe (patch)
tree6dcf656fb19da47833324111efcee62c66809365 /src/CheckIntegrityCommand.cc
parentc9e58779e1a30b32ea2f86e686211d901aca19f0 (diff)
Use std::unique_ptr for CheckIntegrityEntry and FileAllocationEntry
Diffstat (limited to 'src/CheckIntegrityCommand.cc')
-rw-r--r--src/CheckIntegrityCommand.cc14
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);