diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-26 23:56:43 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-26 23:56:43 +0900 |
| commit | da7400ef5c62ee144fc14ba7ca4745349f0b0c72 (patch) | |
| tree | b0d023eecfcfcca2a88eb3466baf878bdff9f4c1 /src/DefaultPieceStorage.cc | |
| parent | 47402c5f29cb806f73aae2ed18aa2dde21956700 (diff) | |
Return std::unique_ptr member as const ref
Returning raw pointer has a risk that it may be stolen by
std::shared_ptr in accident.
Diffstat (limited to 'src/DefaultPieceStorage.cc')
| -rw-r--r-- | src/DefaultPieceStorage.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/DefaultPieceStorage.cc b/src/DefaultPieceStorage.cc index 811c68b7..cee96df9 100644 --- a/src/DefaultPieceStorage.cc +++ b/src/DefaultPieceStorage.cc @@ -478,8 +478,7 @@ void DefaultPieceStorage::completePiece(const std::shared_ptr<Piece>& piece) } #ifdef ENABLE_BITTORRENT if(downloadContext_->hasAttribute(CTX_ATTR_BT)) { - auto torrentAttrs = bittorrent::getTorrentAttrs(downloadContext_); - if(!torrentAttrs->metadata.empty()) { + if(!bittorrent::getTorrentAttrs(downloadContext_)->metadata.empty()) { #ifdef __MINGW32__ // On Windows, if aria2 opens files with GENERIC_WRITE access // right, some programs cannot open them aria2 is seeding. To |
