aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-display.c
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2014-08-07 17:20:03 +0800
committerTomas Popela <tpopela@redhat.com>2014-08-07 17:20:03 +0800
commita0b11ce4ac8602a77e51c64d904ee9314bc9d10b (patch)
tree2f8b49325eed859aa8a14c2f5bdb1970a326a0b4 /mail/e-mail-display.c
parentba8b45931956123e1621a669aee661e21c3287c0 (diff)
downloadgsoc2013-evolution-a0b11ce4ac8602a77e51c64d904ee9314bc9d10b.tar
gsoc2013-evolution-a0b11ce4ac8602a77e51c64d904ee9314bc9d10b.tar.gz
gsoc2013-evolution-a0b11ce4ac8602a77e51c64d904ee9314bc9d10b.tar.bz2
gsoc2013-evolution-a0b11ce4ac8602a77e51c64d904ee9314bc9d10b.tar.lz
gsoc2013-evolution-a0b11ce4ac8602a77e51c64d904ee9314bc9d10b.tar.xz
gsoc2013-evolution-a0b11ce4ac8602a77e51c64d904ee9314bc9d10b.tar.zst
gsoc2013-evolution-a0b11ce4ac8602a77e51c64d904ee9314bc9d10b.zip
Reduce the memory used by DOM variables
Free some of the DOM variables when they are not needed, before they are automatically freed when the frame is destroyed
Diffstat (limited to 'mail/e-mail-display.c')
-rw-r--r--mail/e-mail-display.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index c610636ee9..74010e1ff9 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -314,7 +314,7 @@ find_element_by_id (WebKitDOMDocument *document,
const gchar *id)
{
WebKitDOMNodeList *frames;
- WebKitDOMElement *element;
+ WebKitDOMElement *element = NULL;
gulong ii, length;
if (!WEBKIT_DOM_IS_DOCUMENT (document))
@@ -342,10 +342,12 @@ find_element_by_id (WebKitDOMDocument *document,
element = find_element_by_id (frame_doc, id);
if (element != NULL)
- return element;
+ goto out;
}
+ out:
+ g_object_unref (frames);
- return NULL;
+ return element;
}
static void
@@ -924,6 +926,7 @@ setup_image_click_event_listeners_on_document (WebKitDOMDocument *document,
G_CALLBACK (toggle_address_visibility), FALSE,
NULL);
}
+ g_object_unref (list);
}
static void
@@ -2110,10 +2113,14 @@ mail_display_get_frame_selection_text (WebKitDOMElement *iframe)
text = mail_display_get_frame_selection_text (
WEBKIT_DOM_ELEMENT (node));
- if (text != NULL)
+ if (text != NULL) {
+ g_object_unref (frames);
return text;
+ }
}
+ g_object_unref (frames);
+
return NULL;
}
@@ -2142,10 +2149,14 @@ e_mail_display_get_selection_plain_text (EMailDisplay *display)
text = mail_display_get_frame_selection_text (
WEBKIT_DOM_ELEMENT (node));
- if (text != NULL)
+ if (text != NULL) {
+ g_object_unref (frames);
return text;
+ }
}
+ g_object_unref (frames);
+
return NULL;
}