[gtk+] gtkmodelmenuitem: don't crash on missing action
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtkmodelmenuitem: don't crash on missing action
- Date: Tue, 20 Dec 2011 15:52:03 +0000 (UTC)
commit bac58abec38f78d3f26e8fa638b02c2709137032
Author: Ryan Lortie <desrt desrt ca>
Date: Tue Dec 20 10:44:50 2011 -0500
gtkmodelmenuitem: don't crash on missing action
gtk/gtkmodelmenuitem.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkmodelmenuitem.c b/gtk/gtkmodelmenuitem.c
index ed49daf..eb7b8f3 100644
--- a/gtk/gtkmodelmenuitem.c
+++ b/gtk/gtkmodelmenuitem.c
@@ -238,14 +238,15 @@ gtk_model_menu_item_setup (GtkModelMenuItem *item,
g_action_observable_register_observer (actions, item->action_name, G_ACTION_OBSERVER (item));
if (g_action_group_query_action (G_ACTION_GROUP (actions), item->action_name, &enabled, &type, NULL, NULL, &state))
- gtk_model_menu_item_action_added (G_ACTION_OBSERVER (item), actions, item->action_name, type, enabled, state);
+ {
+ gtk_model_menu_item_action_added (G_ACTION_OBSERVER (item), actions, item->action_name, type, enabled, state);
+ if (state != NULL)
+ g_variant_unref (state);
+ }
else
gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE);
- if (state != NULL)
- g_variant_unref (state);
-
path = _gtk_accel_path_for_action (item->action_name, item->target);
gtk_menu_item_set_accel_path (GTK_MENU_ITEM (item), path);
g_free (path);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]