diff options
author | Ted Gould <ted@gould.cx> | 2010-03-10 14:26:20 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-03-10 14:26:20 -0600 |
commit | ba4a73a9ea33a1996ff7965dd7996b54901b385a (patch) | |
tree | 1eb0bce05ee22b317d2228c98f9d132eb87f7e58 | |
parent | 64df2c666c7411b43f82ae299fca86c48719354a (diff) | |
download | libayatana-indicator-ba4a73a9ea33a1996ff7965dd7996b54901b385a.tar.gz libayatana-indicator-ba4a73a9ea33a1996ff7965dd7996b54901b385a.tar.bz2 libayatana-indicator-ba4a73a9ea33a1996ff7965dd7996b54901b385a.zip |
Disconnect from theme update when the image goes away.
-rw-r--r-- | libindicator/indicator-image-helper.c | 10 |
1 files changed, 10 insertions, 0 deletions
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; |