[epiphany] ephy-bookmarks-editor: fix memory leak



commit 2af68d193ad50ad25e204da88858c8329a2a59aa
Author: Pavel Vasin <rat4vier gmail com>
Date:   Mon Jun 11 12:28:12 2012 +0400

    ephy-bookmarks-editor: fix memory leak
    
    webkit_favicon_database_get_favicon_uri returns newly allocated string
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677720

 src/bookmarks/ephy-bookmarks-editor.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index f0f4692..0a5d350 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -1460,6 +1460,19 @@ node_dropped_cb (EphyNodeView *view,
 	}
 }
 
+static gboolean
+webkit_favicon_database_has_favicon (WebKitFaviconDatabase *database, const char *page_uri)
+{
+    gboolean result;
+    char *uri;
+
+    uri = webkit_favicon_database_get_favicon_uri (database, page_uri);
+    result = (uri != NULL);
+    g_free (uri);
+
+    return result;
+}
+
 static void
 icon_loaded_cb (WebKitFaviconDatabase *database, GAsyncResult *result, GValue *value)
 {
@@ -1489,7 +1502,7 @@ provide_favicon (EphyNode *node, GValue *value, gpointer user_data)
                 favicon = webkit_favicon_database_try_get_favicon_pixbuf (database, page_location,
 									  FAVICON_SIZE, FAVICON_SIZE);
 
-		if (!favicon && webkit_favicon_database_get_favicon_uri (database, page_location))
+		if (!favicon && webkit_favicon_database_has_favicon (database, page_location))
 		  webkit_favicon_database_get_favicon_pixbuf (database, page_location,
 							      FAVICON_SIZE, FAVICON_SIZE, NULL,
 							      (GAsyncReadyCallback) icon_loaded_cb, value);



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