From ba4a73a9ea33a1996ff7965dd7996b54901b385a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 10 Mar 2010 14:26:20 -0600 Subject: Disconnect from theme update when the image goes away. --- libindicator/indicator-image-helper.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libindicator/indicator-image-helper.c b/libindicator/indicator-image-helper.c index 08a4875..3e8c627 100644 --- a/libindicator/indicator-image-helper.c +++ b/libindicator/indicator-image-helper.c @@ -53,6 +53,15 @@ theme_changed_cb (GtkIconTheme * theme, gpointer user_data) return; } +/* Removes the signal on the theme that was calling update on this + image. */ +static void +image_destroyed_cb (GtkImage * image, gpointer user_data) +{ + g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), theme_changed_cb, image); + return; +} + GtkImage * indicator_image_helper (const gchar * name) { @@ -80,6 +89,7 @@ indicator_image_helper (const gchar * name) /* Connect to all changes */ g_signal_connect(G_OBJECT(gtk_icon_theme_get_default()), "changed", G_CALLBACK(theme_changed_cb), image); + g_signal_connect(G_OBJECT(image), "destroy", G_CALLBACK(image_destroyed_cb), NULL); /* Return our built image */ return image; -- cgit v1.2.3