[evolution] Bug 744401 - Many WebKitDom objects leaked for every message viewed



commit 67bdc6787835ea713de7583c8ed8a3cf1c8ddb5c
Author: Tomas Popela <tpopela redhat com>
Date:   Fri Feb 20 08:03:07 2015 +0100

    Bug 744401 - Many WebKitDom objects leaked for every message viewed
    
    Don't leak the WebKitDOMCSSRuleList object and stop searching when we
    remove the rule to be more efficient.

 e-util/e-web-view.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/e-util/e-web-view.c b/e-util/e-web-view.c
index 86d81e2..6d2f9c2 100644
--- a/e-util/e-web-view.c
+++ b/e-util/e-web-view.c
@@ -3399,21 +3399,19 @@ add_css_rule_into_style_sheet (WebKitDOMDocument *document,
                        webkit_dom_css_style_sheet_remove_rule (
                                WEBKIT_DOM_CSS_STYLE_SHEET (sheet),
                                ii, NULL);
+                       length--;
+                       break;
                }
 
                g_free (rule_selector);
                g_free (rule_text);
        }
 
+       g_object_unref (rules_list);
+
        /* Insert the rule at the end, so it will override previously inserted */
        webkit_dom_css_style_sheet_add_rule (
-               WEBKIT_DOM_CSS_STYLE_SHEET (sheet),
-               selector,
-               style,
-               webkit_dom_css_rule_list_get_length (
-                       webkit_dom_css_style_sheet_get_css_rules (
-                               WEBKIT_DOM_CSS_STYLE_SHEET (sheet))), /* Index */
-               NULL);
+               WEBKIT_DOM_CSS_STYLE_SHEET (sheet), selector, style, length, NULL);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]