diff options
author | Milan Crha <mcrha@redhat.com> | 2012-09-11 18:53:38 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-09-11 18:53:38 +0800 |
commit | b9068f622c6a0ad1009280a34ec78dea8ef1d6f8 (patch) | |
tree | 3fcdea6aa79815192d412caa570d801733b31bbb | |
parent | 32550418d55fb83fd98eacad4d9992314f691530 (diff) | |
download | gsoc2013-evolution-b9068f622c6a0ad1009280a34ec78dea8ef1d6f8.tar gsoc2013-evolution-b9068f622c6a0ad1009280a34ec78dea8ef1d6f8.tar.gz gsoc2013-evolution-b9068f622c6a0ad1009280a34ec78dea8ef1d6f8.tar.bz2 gsoc2013-evolution-b9068f622c6a0ad1009280a34ec78dea8ef1d6f8.tar.lz gsoc2013-evolution-b9068f622c6a0ad1009280a34ec78dea8ef1d6f8.tar.xz gsoc2013-evolution-b9068f622c6a0ad1009280a34ec78dea8ef1d6f8.tar.zst gsoc2013-evolution-b9068f622c6a0ad1009280a34ec78dea8ef1d6f8.zip |
Bug #678835 - Disconnect signal handlers from WebKit plugin widgets on dispose
-rw-r--r-- | mail/e-mail-display.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index aee909dd21..f027e8fd1b 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -264,6 +264,26 @@ mail_display_update_formatter_colors (EMailDisplay *display) } static void +mail_display_plugin_widget_disconnect_children (GtkWidget *widget, + gpointer mail_display) +{ + g_signal_handlers_disconnect_by_data (widget, mail_display); +} + +static void +mail_display_plugin_widget_disconnect (gpointer widget_uri, + gpointer widget, + gpointer mail_display) +{ + if (E_IS_ATTACHMENT_BAR (widget) || + E_IS_ATTACHMENT_BUTTON (widget)) { + g_signal_handlers_disconnect_by_data (widget, mail_display); + } else if (GTK_IS_CONTAINER (widget)) { + gtk_container_foreach (widget, mail_display_plugin_widget_disconnect_children, mail_display); + } +} + +static void mail_display_constructed (GObject *object) { e_extensible_load_extensions (E_EXTENSIBLE (object)); @@ -349,6 +369,7 @@ mail_display_dispose (GObject *object) } if (priv->widgets) { + g_hash_table_foreach (priv->widgets, mail_display_plugin_widget_disconnect, object); g_hash_table_destroy (priv->widgets); priv->widgets = NULL; } @@ -1368,8 +1389,10 @@ mail_display_uri_changed (EMailDisplay *display, { d (printf ("EMailDisplay URI changed, recreating widgets hashtable\n")); - if (display->priv->widgets) + if (display->priv->widgets) { + g_hash_table_foreach (display->priv->widgets, mail_display_plugin_widget_disconnect, display); g_hash_table_destroy (display->priv->widgets); + } display->priv->widgets = g_hash_table_new_full ( g_str_hash, g_str_equal, |