diff options
author | Pavel Vasin <rat4vier@gmail.com> | 2012-06-11 16:28:12 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2012-06-12 17:03:05 +0800 |
commit | 2af68d193ad50ad25e204da88858c8329a2a59aa (patch) | |
tree | f38e89c2ad1fbd54443396c2dd506d7ffa3bf245 | |
parent | 19ccfbca0a09fe5d5728791bd1f90345b5ba77fa (diff) | |
download | gsoc2013-epiphany-2af68d193ad50ad25e204da88858c8329a2a59aa.tar gsoc2013-epiphany-2af68d193ad50ad25e204da88858c8329a2a59aa.tar.gz gsoc2013-epiphany-2af68d193ad50ad25e204da88858c8329a2a59aa.tar.bz2 gsoc2013-epiphany-2af68d193ad50ad25e204da88858c8329a2a59aa.tar.lz gsoc2013-epiphany-2af68d193ad50ad25e204da88858c8329a2a59aa.tar.xz gsoc2013-epiphany-2af68d193ad50ad25e204da88858c8329a2a59aa.tar.zst gsoc2013-epiphany-2af68d193ad50ad25e204da88858c8329a2a59aa.zip |
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
-rw-r--r-- | 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 f0f46929c..0a5d350ad 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); |