Chromium Code Reviews| Index: chrome/browser/profiles/profile_manager.cc |
| diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc |
| index 68f1a1c4e83ff7a87fd324f7ffb238405f255b15..c7f8c99f8937ead9aaa3eba517e9adeca0dca736 100644 |
| --- a/chrome/browser/profiles/profile_manager.cc |
| +++ b/chrome/browser/profiles/profile_manager.cc |
| @@ -1104,7 +1104,8 @@ void ProfileManager::OnProfileCreated(Profile* profile, |
| profile = profile->GetOffTheRecordProfile(); |
| info->created = true; |
| } else { |
| - profile = NULL; |
| + profile = nullptr; |
| + failed_profiles_.emplace_back(std::move(iter->second->profile)); |
|
Peter Kasting
2016/06/13 04:43:20
Nit: There's no real reason here to use emplace_ba
WC Leung
2016/06/13 08:06:45
Acknowledged.
WC Leung
2016/06/15 13:08:39
Done.
|
| profiles_info_.erase(iter); |
| // TODO(yiyaoliu): This is temporary, remove it after it's not used. |
| UMA_HISTOGRAM_COUNTS_100("UMA.ProfilesCount.AfterErase", |
| @@ -1523,7 +1524,8 @@ ProfileManager::ProfileInfo::ProfileInfo( |
| } |
| ProfileManager::ProfileInfo::~ProfileInfo() { |
| - ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); |
| + if (profile) |
| + ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); |
| } |
| #if !defined(OS_ANDROID) |