[epiphany] ephy-web-view: do not allocate variables before they are needed
- From: Xan Lopez <xan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-web-view: do not allocate variables before they are needed
- Date: Sun, 26 Aug 2012 01:23:01 +0000 (UTC)
commit 5b9ba4eaa1f6b20b7283028f0371d3bf776399f8
Author: Xan Lopez <xan igalia com>
Date: Sun Aug 26 03:15:31 2012 +0200
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 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 8d20520..f42cb2d 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]