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. --- apt-private/private-install.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apt-private/private-install.cc') diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 074874903..d2b4bed51 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -128,7 +128,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask, bool Safety) pkgSourceList *List = Cache.GetSourceList(); // Create the package manager and prepare to download - SPtr PM= _system->CreatePM(Cache); + std::unique_ptr PM(_system->CreatePM(Cache)); if (PM->GetArchives(&Fetcher,List,&Recs) == false || _error->PendingError() == true) return false; @@ -492,9 +492,9 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, if (Cache->BrokenCount() != 0) BrokenFix = true; - SPtr Fix; + std::unique_ptr Fix(nullptr); if (_config->FindB("APT::Get::CallResolver", true) == true) - Fix = new pkgProblemResolver(Cache); + Fix.reset(new pkgProblemResolver(Cache)); unsigned short fallback = MOD_INSTALL; if (strcasecmp(CmdL.FileList[0],"remove") == 0) @@ -526,8 +526,8 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache, } - TryToInstall InstallAction(Cache, Fix, BrokenFix); - TryToRemove RemoveAction(Cache, Fix); + TryToInstall InstallAction(Cache, Fix.get(), BrokenFix); + TryToRemove RemoveAction(Cache, Fix.get()); // new scope for the ActionGroup { -- cgit v1.2.3