diff options
author | Xan Lopez <xan@igalia.com> | 2012-08-26 09:15:31 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-08-26 09:15:31 +0800 |
commit | 5b9ba4eaa1f6b20b7283028f0371d3bf776399f8 (patch) | |
tree | 962e1e495d4ce9b466e00fb766493f2540effcbb | |
parent | 5aa6d52df9f24a3bfae876f3ac10b29b7b930dc1 (diff) | |
download | gsoc2013-epiphany-5b9ba4eaa1f6b20b7283028f0371d3bf776399f8.tar.gz gsoc2013-epiphany-5b9ba4eaa1f6b20b7283028f0371d3bf776399f8.tar.zst gsoc2013-epiphany-5b9ba4eaa1f6b20b7283028f0371d3bf776399f8.zip |
ephy-web-view: do not allocate variables before they are needed
Fixes a potential leak in WebKit2 mode.
-rw-r--r-- | embed/ephy-web-view.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); |