Ver Fonte

SessionSerializer: Use std::unique_ptr instead of std::shared_ptr

Tatsuhiro Tsujikawa há 11 anos atrás
pai
commit
b63c1dce08
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      src/SessionSerializer.cc

+ 3 - 3
src/SessionSerializer.cc

@@ -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;