diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-06-18 14:59:44 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-06-18 14:59:44 -0500 |
commit | ad2a11e5f03fb48c74af8e4c0dd09f954cf967a9 (patch) | |
tree | 4e78adb0fc64f3401fd782c36978a51f38cecf89 /libdbusmenu-gtk | |
parent | 8d25c2d3eb7be2813c3763fad0b1b6b0f6d88eea (diff) | |
download | libdbusmenu-ad2a11e5f03fb48c74af8e4c0dd09f954cf967a9.tar.gz libdbusmenu-ad2a11e5f03fb48c74af8e4c0dd09f954cf967a9.tar.bz2 libdbusmenu-ad2a11e5f03fb48c74af8e4c0dd09f954cf967a9.zip |
When a widget internally holds a link to a dbusmenuitem, keep a ref on that dbusmenuitem until that link is removed.
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r-- | libdbusmenu-gtk/parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 9d1b034..b09e984 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -312,7 +312,7 @@ disconnect_from_widget (GtkWidget * widget) pdata->widget = NULL; /* clear the widget's menuitem pointer */ - g_object_steal_data(o, CACHED_MENUITEM); + g_object_set_data(o, CACHED_MENUITEM, NULL); } } @@ -406,7 +406,7 @@ new_menuitem (GtkWidget * widget) pdata->widget = widget; g_object_add_weak_pointer(G_OBJECT (widget), (gpointer*)&pdata->widget); - g_object_set_data(G_OBJECT(widget), CACHED_MENUITEM, item); + g_object_set_data_full(G_OBJECT(widget), CACHED_MENUITEM, g_object_ref(item), g_object_unref); return item; } |