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

Unified Diff: ui/views/controls/menu/menu_controller.cc

Issue 2155243007: Turn Bookmark Menus Async (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
Index: ui/views/controls/menu/menu_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 13d3d3510a45b4cd6a2c358c51e9ff51703bdaca..d4ce542a492d69d60c775147472f90b51472e7e7 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -501,6 +501,12 @@ MenuItemView* MenuController::Run(Widget* parent,
}
void MenuController::Cancel(ExitType type) {
+ // If not currently active, this controller could have been destroyed, and a
+ // menu is attempting to cancel after destruction. No futher canellation is
+ // needed.
+ if (GetActiveInstance() != this)
sky 2016/07/21 16:07:54 Your comment sort of implies this may be called on
jonross 2016/07/21 18:30:25 Correct, MenuItemViews hold onto a raw pointer to
+ return;
+
// If the menu has already been destroyed, no further cancellation is
// needed. We especially don't want to set the |exit_type_| to a lesser
// value.

Powered by Google App Engine
This is Rietveld 408576698