diff options
author | Ted Gould <ted@gould.cx> | 2011-02-24 23:07:07 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-02-24 23:07:07 -0600 |
commit | 8a14b520be730c1ae725f72043298f550c94a2cf (patch) | |
tree | 654c2243ce07c351bd59ff27bc47729095c3dd51 /libdbusmenu-glib/menuitem.c | |
parent | 9e20f80e0b1b0e804c6b9d37c8faaf719ace90ff (diff) | |
parent | d831bc59e28568ba53ff57e76737002a9e2bc866 (diff) | |
download | libdbusmenu-8a14b520be730c1ae725f72043298f550c94a2cf.tar.gz libdbusmenu-8a14b520be730c1ae725f72043298f550c94a2cf.tar.bz2 libdbusmenu-8a14b520be730c1ae725f72043298f550c94a2cf.zip |
Merge from U.Desktop
Diffstat (limited to 'libdbusmenu-glib/menuitem.c')
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index 5202aa1..34147a3 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -1670,11 +1670,22 @@ 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; g_signal_emit(G_OBJECT(mi), signals[EVENT], g_quark_from_string(name), name, variant, timestamp, &handled); if (!handled && class->handle_event != NULL) { - return class->handle_event(mi, name, variant, timestamp); + class->handle_event(mi, name, variant, timestamp); + } + + if (variant != NULL) { + g_variant_unref(variant); } return; |