Index: chrome/browser/profiles/profile_impl.cc |
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc |
index 83e45dfd8406cdac737e08937dd24ebeb45231b2..e698177a5c3e8b48a6b0f6e312e0b5a1077bd9ea 100644 |
--- a/chrome/browser/profiles/profile_impl.cc |
+++ b/chrome/browser/profiles/profile_impl.cc |
@@ -804,6 +804,15 @@ ProfileImpl::~ProfileImpl() { |
default_request_context_ = NULL; |
} |
+ if (bookmark_bar_model_.get()) { |
+ // It's possible that bookmarks haven't loaded and history is waiting for |
+ // bookmarks to complete loading. In such a situation history can't |
+ // shutdown. To break the deadlock we tell BookmarkModel it's about to be |
+ // deleted so that it can release the signal history is waiting on, allowing |
+ // history to shutdown. In such a scenario history sees an incorrect view of |
+ // bookmarks, but it's better than a deadlock. |
+ bookmark_bar_model_->Cleanup(); |
+ } |
// HistoryService may call into the BookmarkModel, as such we need to |
// delete HistoryService before the BookmarkModel. The destructor for |
// HistoryService will join with HistoryService's backend thread so that |