From a0b11ce4ac8602a77e51c64d904ee9314bc9d10b Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Thu, 7 Aug 2014 11:20:03 +0200 Subject: 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 --- modules/itip-formatter/e-mail-part-itip.c | 2 ++ modules/vcard-inline/e-mail-part-vcard.c | 3 +++ 2 files changed, 5 insertions(+) (limited to 'modules') diff --git a/modules/itip-formatter/e-mail-part-itip.c b/modules/itip-formatter/e-mail-part-itip.c index 8dab55d6a2..bcc48dbfd3 100644 --- a/modules/itip-formatter/e-mail-part-itip.c +++ b/modules/itip-formatter/e-mail-part-itip.c @@ -95,6 +95,8 @@ mail_part_itip_bind_dom_element (EMailPart *part, if (length > 0) element = WEBKIT_DOM_ELEMENT ( webkit_dom_node_list_item (nodes, 0)); + + g_object_unref (nodes); } g_return_if_fail (WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT (element)); diff --git a/modules/vcard-inline/e-mail-part-vcard.c b/modules/vcard-inline/e-mail-part-vcard.c index 4cf5bed66b..4335f30324 100644 --- a/modules/vcard-inline/e-mail-part-vcard.c +++ b/modules/vcard-inline/e-mail-part-vcard.c @@ -267,6 +267,7 @@ mail_part_vcard_bind_dom_element (EMailPart *part, iframe = WEBKIT_DOM_ELEMENT (webkit_dom_node_list_item (list, 0)); g_clear_object (&vcard_part->iframe); vcard_part->iframe = g_object_ref (iframe); + g_object_unref (list); /* TOGGLE DISPLAY MODE BUTTON */ list = webkit_dom_element_get_elements_by_class_name ( @@ -276,6 +277,7 @@ mail_part_vcard_bind_dom_element (EMailPart *part, toggle_button = WEBKIT_DOM_ELEMENT (webkit_dom_node_list_item (list, 0)); g_clear_object (&vcard_part->toggle_button); vcard_part->toggle_button = g_object_ref (toggle_button); + g_object_unref (list); /* SAVE TO ADDRESSBOOK BUTTON */ list = webkit_dom_element_get_elements_by_class_name ( @@ -285,6 +287,7 @@ mail_part_vcard_bind_dom_element (EMailPart *part, save_button = WEBKIT_DOM_ELEMENT (webkit_dom_node_list_item (list, 0)); g_clear_object (&vcard_part->save_button); vcard_part->save_button = g_object_ref (save_button); + g_object_unref (list); webkit_dom_event_target_add_event_listener ( WEBKIT_DOM_EVENT_TARGET (toggle_button), -- cgit v1.2.3