diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 21:34:32 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 21:34:32 +0000 |
commit | 987bdf20d17d5a869027032300f1fdd62f6539cf (patch) | |
tree | 0e30fe6cbca8a29b541da9fd7640f5e39713fd2a /chrome/browser/gtk/menu_gtk.cc | |
parent | 5fb67f4f7e9a3b21b6e4eb06e4ab730f7decca79 (diff) | |
download | chromium_src-987bdf20d17d5a869027032300f1fdd62f6539cf.zip chromium_src-987bdf20d17d5a869027032300f1fdd62f6539cf.tar.gz chromium_src-987bdf20d17d5a869027032300f1fdd62f6539cf.tar.bz2 |
GTK: Fix crash when right clicking on a tab in the tabstrip.
http://crbug.com/12439
Review URL: http://codereview.chromium.org/115661
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16663 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/menu_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/menu_gtk.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/gtk/menu_gtk.cc b/chrome/browser/gtk/menu_gtk.cc index e62bff9..24abed8 100644 --- a/chrome/browser/gtk/menu_gtk.cc +++ b/chrome/browser/gtk/menu_gtk.cc @@ -302,9 +302,14 @@ void MenuGtk::OnMenuHidden(GtkWidget* widget, MenuGtk* menu) { // static void MenuGtk::SetMenuItemInfo(GtkWidget* widget, gpointer userdata) { + if (GTK_IS_SEPARATOR_MENU_ITEM(widget)) { + // We need to explicitly handle this case because otherwise we'll ask the + // menu delegate about something with an invalid id. + return; + } + MenuGtk* menu = reinterpret_cast<MenuGtk*>(userdata); int id; - const MenuCreateMaterial* data = reinterpret_cast<const MenuCreateMaterial*>( g_object_get_data(G_OBJECT(widget), "menu-data")); |