diff options
author | Jonathan Landis <jkl102001@yahoo.com> | 2011-06-16 22:25:56 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-06-16 22:25:56 -0500 |
commit | 2578c3858e862553b07bf106c32d8db0d3645ea0 (patch) | |
tree | 9df4ae1dbf10dacf1a79a8184eb3b9a9c519dee7 /libdbusmenu-glib/menuitem.c | |
parent | 4e209b214ebb906a18e8c33b204aab6c605fd614 (diff) | |
download | libdbusmenu-2578c3858e862553b07bf106c32d8db0d3645ea0.tar.gz libdbusmenu-2578c3858e862553b07bf106c32d8db0d3645ea0.tar.bz2 libdbusmenu-2578c3858e862553b07bf106c32d8db0d3645ea0.zip |
Fix for several issues as documented in bug 784890
Diffstat (limited to 'libdbusmenu-glib/menuitem.c')
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index bdaf49f..e07fc37 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -1694,25 +1694,20 @@ dbusmenu_menuitem_handle_event (DbusmenuMenuitem * mi, const gchar * name, GVari #endif DbusmenuMenuitemClass * class = DBUSMENU_MENUITEM_GET_CLASS(mi); - /* We need to keep a ref to the variant because the signal - handler will drop the floating ref and then we'll be up - a creek if we don't have our own later. */ - if (variant != NULL) { - g_variant_ref_sink(variant); + gboolean handled = FALSE; + if (variant == NULL) { + variant = g_variant_new("i", 0); } - gboolean handled = FALSE; + g_variant_ref_sink(variant); + g_signal_emit(G_OBJECT(mi), signals[EVENT], g_quark_from_string(name), name, variant, timestamp, &handled); if (!handled && class->handle_event != NULL) { class->handle_event(mi, name, variant, timestamp); } - if (variant != NULL) { - g_variant_unref(variant); - } - - return; + g_variant_unref(variant); } /** |