diff options
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r-- | libdbusmenu-gtk/parser.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 8420770..cf2003f 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -155,6 +155,14 @@ parse_data_free (gpointer data) return; } +static void +widget_freed (gpointer data, GObject * obj) +{ + g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), G_CALLBACK(theme_changed_cb), obj); + + return; +} + /* Called when the dbusmenu item that we're keeping around is finalized */ static void @@ -163,18 +171,12 @@ dbusmenu_item_freed (gpointer data, GObject * obj) ParserData *pdata = (ParserData *)g_object_get_data(G_OBJECT(obj), PARSER_DATA); if (pdata != NULL && pdata->widget != NULL) { + g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), G_CALLBACK(theme_changed_cb), pdata->widget); g_object_steal_data(G_OBJECT(pdata->widget), CACHED_MENUITEM); + g_object_weak_unref(G_OBJECT(pdata->widget), widget_freed, NULL); } } -static void -widget_freed (gpointer data, GObject * obj) -{ - g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), G_CALLBACK(theme_changed_cb), obj); - - return; -} - /* Gets the positon of the child with its' parent if it has one. Returns -1 if the position is unable to be calculated. */ static gint |