aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk/parser.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-01 11:41:58 -0600
committerTed Gould <ted@gould.cx>2011-03-01 11:41:58 -0600
commitb9aabb88761d30b5edd2e84d422698ed80aae349 (patch)
tree4388c2698d3cfe3dd6883e7fab4c4bee08226357 /libdbusmenu-gtk/parser.c
parent5a853be00dee3bf3b62191568e9910da903a6237 (diff)
parentb8c5def4dd43b7061a65ba87f65b4b578a9d5c35 (diff)
downloadlibdbusmenu-b9aabb88761d30b5edd2e84d422698ed80aae349.tar.gz
libdbusmenu-b9aabb88761d30b5edd2e84d422698ed80aae349.tar.bz2
libdbusmenu-b9aabb88761d30b5edd2e84d422698ed80aae349.zip
Disconnecting theme changed on normal cleanup as well to ensure it's benign.
Diffstat (limited to 'libdbusmenu-gtk/parser.c')
-rw-r--r--libdbusmenu-gtk/parser.c18
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