[epiphany] ephy-web-view: manually unref DOM objects when needed



commit d3012a7f87b3d55effdbb20806d97528431b70cf
Author: Xan Lopez <xan gnome org>
Date:   Sun Nov 21 17:15:05 2010 -0500

    ephy-web-view: manually unref DOM objects when needed
    
    Some DOM objects are not garbage collected by WebKit (since they are
    not in the DOM tree), manually unref them when they are not needed
    anymore.

 embed/ephy-web-view.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index e1d25e2..e45ecf2 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -656,6 +656,8 @@ find_username_and_password_elements (WebKitDOMNode *form_node,
       g_free (element_type);
     }
   }
+
+  g_object_unref(elements);
 }
 
 typedef struct {
@@ -938,6 +940,7 @@ _ephy_web_view_hook_into_forms (EphyWebView *web_view)
 
   if (forms_n == 0) {
     LOG ("No forms found.");
+    g_object_unref(forms);
     return;
   }
 
@@ -962,6 +965,8 @@ _ephy_web_view_hook_into_forms (EphyWebView *web_view)
     } else
       LOG ("No pre-fillable/hookable form found");
   }
+
+  g_object_unref(forms);
 }
 
 static void
@@ -978,6 +983,7 @@ _ephy_web_view_hook_into_links (EphyWebView *web_view)
 
   if (links_n == 0) {
     LOG ("No links found.");
+    g_object_unref(links);
     return;
   }
 
@@ -1023,6 +1029,8 @@ _ephy_web_view_hook_into_links (EphyWebView *web_view)
 
     g_free (rel);
   }
+
+  g_object_unref(links);
 }
 
 static void



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