summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 21:52:41 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 21:52:41 +0000
commitbec0b3244315aac937842bbb649530b6a3e70ed2 (patch)
treec2fb1a0d0ff7b7f769253aa7c0e5e70b2d027623 /chrome
parent10a1fe9bc36ae828e5baf53d155d2a59d7eb3f93 (diff)
downloadchromium_src-bec0b3244315aac937842bbb649530b6a3e70ed2.zip
chromium_src-bec0b3244315aac937842bbb649530b6a3e70ed2.tar.gz
chromium_src-bec0b3244315aac937842bbb649530b6a3e70ed2.tar.bz2
Fixes possible crash in menu code. If after dropping you quickly right
click the mouse we would crash. This is the same fix as you first saw, I couldn't repro interactive ui test anymore. BUG=4047 TEST=see bug git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/views/chrome_menu.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/views/chrome_menu.cc b/chrome/views/chrome_menu.cc
index 77c33e9..209e02e 100644
--- a/chrome/views/chrome_menu.cc
+++ b/chrome/views/chrome_menu.cc
@@ -1070,6 +1070,13 @@ void MenuItemView::RunMenuAt(HWND parent,
int mouse_event_flags;
MenuController* controller = MenuController::GetActiveInstance();
+ if (controller && !controller->IsBlockingRun()) {
+ // A menu is already showing, but it isn't a blocking menu. Cancel it.
+ // We can get here during drag and drop if the user right clicks on the
+ // menu quickly after the drop.
+ controller->Cancel(true);
+ controller = NULL;
+ }
bool owns_controller = false;
if (!controller) {
// No menus are showing, show one.