mirror of https://github.com/aria2/aria2
SessionSerializer: Use std::unique_ptr instead of std::shared_ptr
parent
306d92a1da
commit
b63c1dce08
|
@ -74,15 +74,15 @@ bool SessionSerializer::save(const std::string& filename) const
|
|||
std::string tempFilename = filename;
|
||||
tempFilename += "__temp";
|
||||
{
|
||||
std::shared_ptr<IOFile> fp;
|
||||
std::unique_ptr<IOFile> fp;
|
||||
#if HAVE_ZLIB
|
||||
if (util::endsWith(filename, ".gz")) {
|
||||
fp = std::make_shared<GZipFile>(tempFilename.c_str(), IOFile::WRITE);
|
||||
fp = make_unique<GZipFile>(tempFilename.c_str(), IOFile::WRITE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
fp = std::make_shared<BufferedFile>(tempFilename.c_str(), IOFile::WRITE);
|
||||
fp = make_unique<BufferedFile>(tempFilename.c_str(), IOFile::WRITE);
|
||||
}
|
||||
if(!*fp) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue