From 5b9ba4eaa1f6b20b7283028f0371d3bf776399f8 Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Sun, 26 Aug 2012 03:15:31 +0200 Subject: ephy-web-view: do not allocate variables before they are needed Fixes a potential leak in WebKit2 mode. --- embed/ephy-web-view.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'embed') diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 8d20520e1..f42cb2dd1 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1208,9 +1208,6 @@ uri_changed_cb (WebKitWebView *web_view, char *uri; const char *current_address; - g_object_get (web_view, "uri", &uri, NULL); - current_address = ephy_web_view_get_address (EPHY_WEB_VIEW (web_view)); - #ifdef HAVE_WEBKIT2 if (!EPHY_WEB_VIEW (web_view)->priv->is_loading) return; @@ -1219,6 +1216,9 @@ uri_changed_cb (WebKitWebView *web_view, /* We need to check if we get URI notifications without going through the usual load process, as this can happen when changing location within a page */ + current_address = ephy_web_view_get_address (EPHY_WEB_VIEW (web_view)); + g_object_get (web_view, "uri", &uri, NULL); + if (g_str_equal (uri, current_address) == FALSE) ephy_web_view_set_address (EPHY_WEB_VIEW (web_view), uri); -- cgit v1.2.3