aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2012-06-28 01:06:03 +0800
committerDan Vrátil <dvratil@redhat.com>2012-06-28 01:07:27 +0800
commit0da915da8d8a1d2d584fe905bb4673c25db14fb9 (patch)
tree4aa5d4607df982b5594951a796202fb5c905f72f /mail
parent8de1c927dfbc915ba1aa1157aa62a54a7824fbfa (diff)
downloadgsoc2013-evolution-0da915da8d8a1d2d584fe905bb4673c25db14fb9.tar.gz
gsoc2013-evolution-0da915da8d8a1d2d584fe905bb4673c25db14fb9.tar.zst
gsoc2013-evolution-0da915da8d8a1d2d584fe905bb4673c25db14fb9.zip
Cancel scheduled EMailDisplay reload in _dispose()
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-display.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index 07dd09c6de..d265871602 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -76,7 +76,7 @@ struct _EMailDisplayPrivate {
GHashTable *widgets;
- guint reload_scheduled: 1;
+ guint scheduled_reload;
};
enum {
@@ -339,6 +339,11 @@ mail_display_dispose (GObject *object)
priv = E_MAIL_DISPLAY_GET_PRIVATE (object);
+ if (priv->scheduled_reload > 0) {
+ g_source_remove (priv->scheduled_reload);
+ priv->scheduled_reload = 0;
+ }
+
if (priv->part_list) {
g_object_unref (priv->part_list);
priv->part_list = NULL;
@@ -1467,6 +1472,7 @@ e_mail_display_init (EMailDisplay *display)
display->priv->mode = E_MAIL_FORMATTER_MODE_INVALID;
e_mail_display_set_mode (display, E_MAIL_FORMATTER_MODE_NORMAL);
display->priv->force_image_load = FALSE;
+ display->priv->scheduled_reload = 0;
webkit_web_view_set_full_content_zoom (WEBKIT_WEB_VIEW (display), TRUE);
@@ -1723,7 +1729,7 @@ do_reload_display (EMailDisplay *display)
web_view = E_WEB_VIEW (display);
uri = e_web_view_get_uri (web_view);
- display->priv->reload_scheduled = FALSE;
+ display->priv->scheduled_reload = 0;
if (!uri || !*uri)
return FALSE;
@@ -1765,12 +1771,12 @@ e_mail_display_reload (EMailDisplay *display)
{
g_return_if_fail (E_IS_MAIL_DISPLAY (display));
- if (display->priv->reload_scheduled)
+ if (display->priv->scheduled_reload > 0)
return;
/* Schedule reloading if neccessary */
- g_idle_add ((GSourceFunc) do_reload_display, display);
- display->priv->reload_scheduled = TRUE;
+ display->priv->scheduled_reload =
+ g_idle_add ((GSourceFunc) do_reload_display, display);
}
GtkAction *