aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2012-09-04 16:46:49 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2012-09-04 16:46:49 +0800
commit3e7c36a33f512e47b9bc293db93112c109caaf0b (patch)
tree9645569ebde813626b1781bfcc5873182732928c
parentaea0c271af64fef12c887c04cc2f760aca8391f8 (diff)
downloadgsoc2013-epiphany-3e7c36a33f512e47b9bc293db93112c109caaf0b.tar.gz
gsoc2013-epiphany-3e7c36a33f512e47b9bc293db93112c109caaf0b.tar.zst
gsoc2013-epiphany-3e7c36a33f512e47b9bc293db93112c109caaf0b.zip
ephy-web-view: don't leak the snapsoht cairo surface
-rw-r--r--embed/ephy-web-view.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 234126e60..ece575b82 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -2103,12 +2103,15 @@ web_view_check_snapshot (WebKitWebView *web_view)
{
EphyOverviewStore *store;
GtkTreeIter iter;
+ cairo_surface_t *surface;
store = EPHY_OVERVIEW_STORE (ephy_embed_shell_get_frecent_store (embed_shell));
if (ephy_overview_store_find_url (store, webkit_web_view_get_uri (web_view), &iter) &&
- ephy_overview_store_needs_snapshot (store, &iter))
- ephy_overview_store_set_snapshot (store, &iter,
- webkit_web_view_get_snapshot (web_view));
+ ephy_overview_store_needs_snapshot (store, &iter)) {
+ surface = webkit_web_view_get_snapshot (web_view);
+ ephy_overview_store_set_snapshot (store, &iter, surface);
+ cairo_surface_destroy (surface);
+ }
return FALSE;
}