diff options
author | Julian Andres Klode <jak@debian.org> | 2015-08-13 10:49:31 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2015-08-13 11:30:59 +0200 |
commit | 6c413b188618b9fcb5368b60971dfa5d45b3cd74 (patch) | |
tree | b50631d5318f7846368b9cc32f02568bdf86d895 /apt-private/private-install.cc | |
parent | 47c37a1bfc2f2f372bf057bf68bde0b3b6f0ec8f (diff) |
Mark SPtr as deprecated, and convert users to std::unique_ptr
Switch to std::unique_ptr, as this is safer than SPtr.
Diffstat (limited to 'apt-private/private-install.cc')
-rw-r--r-- | apt-private/private-install.cc | 10 |
1 files changed, 5 insertions, 5 deletions
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<pkgPackageManager> PM= _system->CreatePM(Cache); + std::unique_ptr<pkgPackageManager> 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<pkgProblemResolver> Fix; + std::unique_ptr<pkgProblemResolver> 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 { |