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

Unified Diff: chrome/browser/views/bookmark_bar_view.cc

Issue 1664001: Fixes possible crash if the window hosting a menu was closed while the (Closed)
Patch Set: Incorporated review feedback Created 10 years, 8 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 | chrome/browser/views/bookmark_bar_view_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/bookmark_bar_view.cc
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index a1cecbfb745dd0d39d7de73604566b4827136a8a..df16ac7ab1261d7f1dcee8cf88877667bcb9123b 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -412,6 +412,12 @@ BookmarkBarView::~BookmarkBarView() {
NotifyModelChanged();
if (model_)
model_->RemoveObserver(this);
+
+ // It's possible for the menu to outlive us, reset the observer to make sure
+ // it doesn't have a reference to us.
+ if (bookmark_menu_)
+ bookmark_menu_->set_observer(NULL);
+
StopShowFolderDropMenuTimer();
if (sync_service_)
« no previous file with comments | « no previous file | chrome/browser/views/bookmark_bar_view_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698