aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-10-14 08:37:32 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-10-14 08:37:32 +0800
commit890f31bd076da194c5b7ea8022e72c8aad4a0de1 (patch)
tree376cb5e9c7e5c42be62c04c5ebac36e1204eab1b
parent446cd75900b3636156a92f764cb2db5306b687ec (diff)
downloadgsoc2013-evolution-890f31bd076da194c5b7ea8022e72c8aad4a0de1.tar
gsoc2013-evolution-890f31bd076da194c5b7ea8022e72c8aad4a0de1.tar.gz
gsoc2013-evolution-890f31bd076da194c5b7ea8022e72c8aad4a0de1.tar.bz2
gsoc2013-evolution-890f31bd076da194c5b7ea8022e72c8aad4a0de1.tar.lz
gsoc2013-evolution-890f31bd076da194c5b7ea8022e72c8aad4a0de1.tar.xz
gsoc2013-evolution-890f31bd076da194c5b7ea8022e72c8aad4a0de1.tar.zst
gsoc2013-evolution-890f31bd076da194c5b7ea8022e72c8aad4a0de1.zip
Bug 685786 - EWebView: Signal handlers never disconnected
Both EWebView and EMailDisplay listen for "changed" signals from a GSettings instance, passing itself as the 'user_data' to the signal handler e_web_view_update_fonts(). But in both cases the signal handler was left connected after EWebView and EMailDisplay were finalized, resulting in the signal handler receiving a dangling pointer. Not using g_signal_connect_object() here because of the unresolved reference leak issue in GObject. The GSettings instance is likely cached internally and lives well beyond EWebView and EMailDisplay.
-rw-r--r--mail/e-mail-display.c9
-rw-r--r--widgets/misc/e-web-view.c6
2 files changed, 14 insertions, 1 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index 82934ea642..5e33ccd570 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -1313,8 +1313,15 @@ mail_display_dispose (GObject *object)
priv->widgets = NULL;
}
+ if (priv->settings != NULL) {
+ g_signal_handlers_disconnect_matched (
+ priv->settings, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, object);
+ g_object_unref (priv->settings);
+ priv->settings = NULL;
+ }
+
g_clear_object (&priv->part_list);
- g_clear_object (&priv->settings);
g_clear_object (&priv->formatter);
/* Chain up to parent's dispose() method. */
diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c
index e1fb5c54a6..84c473dc37 100644
--- a/widgets/misc/e-web-view.c
+++ b/widgets/misc/e-web-view.c
@@ -803,11 +803,17 @@ web_view_dispose (GObject *object)
}
if (priv->aliasing_settings != NULL) {
+ g_signal_handlers_disconnect_matched (
+ priv->aliasing_settings, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, object);
g_object_unref (priv->aliasing_settings);
priv->aliasing_settings = NULL;
}
if (priv->font_settings != NULL) {
+ g_signal_handlers_disconnect_matched (
+ priv->font_settings, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, object);
g_object_unref (priv->font_settings);
priv->font_settings = NULL;
}