[gtk+/composite-templates] menubutton: don't dereference NULL GdkEvent
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/composite-templates] menubutton: don't dereference NULL GdkEvent
- Date: Mon, 2 Jul 2012 19:46:09 +0000 (UTC)
commit b33ddf791edaa982d386b426ed3a0f7c1d43439f
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Fri Jun 29 18:30:53 2012 -0400
menubutton: don't dereference NULL GdkEvent
Since we explictly call popup_menu with NULL when it's
keyboard-activated, we need to be careful and not access event->device
without checking for event != NULL before.
gtk/gtkmenubutton.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
index 4c1a2f1..63bea8c 100644
--- a/gtk/gtkmenubutton.c
+++ b/gtk/gtkmenubutton.c
@@ -307,7 +307,9 @@ popup_menu (GtkMenuButton *menu_button,
break;
}
- gtk_menu_popup_for_device (GTK_MENU (priv->menu), event->device, NULL, NULL,
+ gtk_menu_popup_for_device (GTK_MENU (priv->menu),
+ event ? event->device : NULL,
+ NULL, NULL,
func,
GTK_WIDGET (menu_button),
NULL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]