[gnome-control-center] Fix possible crasher when theme changes
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Fix possible crasher when theme changes
- Date: Thu, 22 Jul 2010 14:59:54 +0000 (UTC)
commit b8e36d565815441e75ecb41234740be6bc66b7ef
Author: Bastien Nocera <hadess hadess net>
Date: Thu Jul 22 15:56:26 2010 +0100
Fix possible crasher when theme changes
When the theme or screen changes, we need to make sure that
the previous handler for the theme-changed signal is disconnected
to avoid the callback being called when the panel has been unloaded.
https://bugzilla.redhat.com/show_bug.cgi?id=610289
.../cc-default-applications-panel.c | 7 +++++++
panels/default-applications/gnome-da-capplet.c | 2 +-
panels/default-applications/gnome-da-capplet.h | 2 ++
3 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/panels/default-applications/cc-default-applications-panel.c b/panels/default-applications/cc-default-applications-panel.c
index fc077e8..88d5175 100644
--- a/panels/default-applications/cc-default-applications-panel.c
+++ b/panels/default-applications/cc-default-applications-panel.c
@@ -72,6 +72,13 @@ cc_default_applications_panel_dispose (GObject *object)
g_object_unref (priv->capplet->gconf);
gnome_da_xml_free (priv->capplet);
+ if (priv->capplet->theme_changed_id > 0)
+ {
+ g_signal_handler_disconnect (priv->capplet->icon_theme,
+ priv->capplet->theme_changed_id);
+ priv->capplet->theme_changed_id = 0;
+ }
+
priv->capplet = NULL;
}
diff --git a/panels/default-applications/gnome-da-capplet.c b/panels/default-applications/gnome-da-capplet.c
index d7682bc..c77b8af 100644
--- a/panels/default-applications/gnome-da-capplet.c
+++ b/panels/default-applications/gnome-da-capplet.c
@@ -286,7 +286,7 @@ screen_changed_cb (GtkWidget *widget, GdkScreen *screen, GnomeDACapplet *capplet
if (capplet->icon_theme != NULL) {
g_signal_handlers_disconnect_by_func (capplet->icon_theme, theme_changed_cb, capplet);
}
- g_signal_connect (theme, "changed", G_CALLBACK (theme_changed_cb), capplet);
+ capplet->theme_changed_id = g_signal_connect (theme, "changed", G_CALLBACK (theme_changed_cb), capplet);
theme_changed_cb (theme, capplet);
capplet->icon_theme = theme;
diff --git a/panels/default-applications/gnome-da-capplet.h b/panels/default-applications/gnome-da-capplet.h
index c4ebea8..a404d8d 100644
--- a/panels/default-applications/gnome-da-capplet.h
+++ b/panels/default-applications/gnome-da-capplet.h
@@ -121,6 +121,8 @@ struct _GnomeDACapplet {
GList *media_players;
GList *visual_ats;
GList *mobility_ats;
+
+ guint theme_changed_id;
};
void gnome_default_applications_panel_init (GnomeDACapplet *capplet);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]