Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Unified Diff: chrome/browser/android/most_visited_sites.cc

Issue 501973004: [Sync] Fix a crash when sign into sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/most_visited_sites.cc
diff --git a/chrome/browser/android/most_visited_sites.cc b/chrome/browser/android/most_visited_sites.cc
index 2cd9c4a042d345bdf03512d8df569657d2784be6..7b71164d397495c8309a6f078e6be3490ee2eafa 100644
--- a/chrome/browser/android/most_visited_sites.cc
+++ b/chrome/browser/android/most_visited_sites.cc
@@ -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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698