Commit 94a4210d authored by feng's avatar feng Committed by Commit bot

[Sync] Fix a crash when sign into sync.

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}
parent 64df1add
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment