Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[Sync] Fix a crash when sign into sync.
Browse files Browse the repository at this point in the history
The crash was caused by a dangling pointer to a deleted observer
registered by MostVisitedSites.

BUG=406996

Review URL: https://codereview.chromium.org/501973004

Cr-Commit-Position: refs/heads/master@{#292034}
  • Loading branch information
feng authored and Commit bot committed Aug 26, 2014
1 parent 64df1ad commit 94a4210
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chrome/browser/android/most_visited_sites.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ MostVisitedSites::MostVisitedSites(Profile* profile)
}

MostVisitedSites::~MostVisitedSites() {
ProfileSyncService* profile_sync_service =
ProfileSyncServiceFactory::GetForProfile(profile_);
if (profile_sync_service && profile_sync_service->HasObserver(this))
profile_sync_service->RemoveObserver(this);
}

void MostVisitedSites::Destroy(JNIEnv* env, jobject obj) {
Expand Down

0 comments on commit 94a4210

Please sign in to comment.