From 6c413b188618b9fcb5368b60971dfa5d45b3cd74 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 13 Aug 2015 10:49:31 +0200 Subject: Mark SPtr as deprecated, and convert users to std::unique_ptr Switch to std::unique_ptr, as this is safer than SPtr. --- cmdline/apt-get.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index b0e646833..0b79c507a 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1000,7 +1000,7 @@ static bool DoBuildDep(CommandLine &CmdL) { string Src; pkgSrcRecords::Parser *Last = 0; - SPtr LastOwner; + std::unique_ptr LastOwner; // an unpacked debian source tree using APT::String::Startswith; @@ -1012,7 +1012,7 @@ static bool DoBuildDep(CommandLine &CmdL) std::string TypeName = "Debian control file"; pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str()); if(Type != NULL) - LastOwner = Last = Type->CreateSrcPkgParser(*I); + LastOwner.reset(Last = Type->CreateSrcPkgParser(*I)); } // if its a local file (e.g. .dsc) use this else if (FileExists(*I)) @@ -1023,7 +1023,7 @@ static bool DoBuildDep(CommandLine &CmdL) string TypeName = "Debian " + flExtension(*I) + " file"; pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str()); if(Type != NULL) - LastOwner = Last = Type->CreateSrcPkgParser(*I); + LastOwner.reset(Last = Type->CreateSrcPkgParser(*I)); } else { // normal case, search the cache for the source file Last = FindSrc(*I,SrcRecs,Src,Cache); -- cgit v1.2.3