DownloadContext::attrs_ now holds std::unique_ptr

DownloadContext::getAttribute() returns a raw pointer.
This commit is contained in:
Tatsuhiro Tsujikawa 2013-06-23 00:59:55 +09:00
parent 1a299c4d7c
commit bef6236da8
29 changed files with 146 additions and 157 deletions

View file

@ -33,9 +33,11 @@ public:
dctx_.reset(new DownloadContext());
unsigned char infoHash[20];
memset(infoHash, 0, sizeof(infoHash));
std::shared_ptr<TorrentAttribute> torrentAttrs(new TorrentAttribute());
torrentAttrs->infoHash = std::string(vbegin(infoHash), vend(infoHash));
dctx_->setAttribute(CTX_ATTR_BT, torrentAttrs);
{
auto torrentAttrs = make_unique<TorrentAttribute>();
torrentAttrs->infoHash = std::string(vbegin(infoHash), vend(infoHash));
dctx_->setAttribute(CTX_ATTR_BT, std::move(torrentAttrs));
}
}
void testHandshake();