diff --git a/examples/libaria2ex.cc b/examples/libaria2ex.cc index e0200034..c22ac606 100644 --- a/examples/libaria2ex.cc +++ b/examples/libaria2ex.cc @@ -41,7 +41,7 @@ #include int downloadEventCallback(aria2::Session* session, aria2::DownloadEvent event, - const aria2::A2Gid& gid, void* userData) + aria2::A2Gid gid, void* userData) { switch(event) { case aria2::EVENT_ON_DOWNLOAD_COMPLETE: diff --git a/src/KeepRunningCommand.cc b/src/KeepRunningCommand.cc index 995f3027..af15ce3c 100644 --- a/src/KeepRunningCommand.cc +++ b/src/KeepRunningCommand.cc @@ -52,7 +52,7 @@ bool KeepRunningCommand::execute() if(e_->isHaltRequested()) { return true; } - e_->addCommand(this); + e_->addCommand(std::unique_ptr(this)); return false; } diff --git a/src/aria2api.cc b/src/aria2api.cc index a9a1e131..980e3c45 100644 --- a/src/aria2api.cc +++ b/src/aria2api.cc @@ -128,7 +128,7 @@ Session* sessionNew(const KeyVals& options, const SessionConfig& config) if(config.keepRunning) { e->getRequestGroupMan()->setKeepRunning(true); // Add command to make aria2 keep event polling - e->addCommand(new KeepRunningCommand(e->newCUID(), e.get())); + e->addCommand(make_unique(e->newCUID(), e.get())); } if(config.downloadEventCallback) { std::shared_ptr listener