diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-04 20:57:51 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-04 20:57:51 +0000 |
commit | 92673042f3c1edd0d7a4bded0a09f7d4f4cfeee8 (patch) | |
tree | b1a123f1cf7d58a72cdac2944241180c41c6564c /chrome | |
parent | 42ea87098d2fd5dd54d87043746ff9b4b93d47a3 (diff) | |
download | chromium_src-92673042f3c1edd0d7a4bded0a09f7d4f4cfeee8.zip chromium_src-92673042f3c1edd0d7a4bded0a09f7d4f4cfeee8.tar.gz chromium_src-92673042f3c1edd0d7a4bded0a09f7d4f4cfeee8.tar.bz2 |
Fixes possible crash in menu code. If after dropping you quickly right
click the mouse we would crash.
BUG=4047
TEST=see bug
Review URL: http://codereview.chromium.org/9346
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4647 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/views/chrome_menu.cc | 7 |
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. |