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

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

Issue 1863393006: MacViews: Fix MenuRunnerTests which fail with asan enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fcc41e8168a96ca30a5f3bf1225600be20e47fd6..c8166a5b590809021ddb264b99d3a362e6494844 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -1030,7 +1030,10 @@ ui::PostDispatchAction MenuController::OnWillDispatchKeyEvent(
else
OnKeyDown(key_code);
- TerminateNestedMessageLoopIfNecessary();
+ // MenuController may have been deleted, so check for an active instance
+ // before accessing member variables.
+ if (GetActiveInstance())
+ TerminateNestedMessageLoopIfNecessary();
return ui::POST_DISPATCH_NONE;
}
« 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