[yelp] yelp-view: Don't free the passed GError in view_show_error_page()
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp] yelp-view: Don't free the passed GError in view_show_error_page()
- Date: Wed, 21 Nov 2012 15:26:31 +0000 (UTC)
commit 22ce877d810020ae69dd1509a4a5d3c3b55836d0
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Fri Aug 31 12:30:49 2012 +0200
yelp-view: Don't free the passed GError in view_show_error_page()
The error should be considered as a const parameter, and it should be
freed by the caller that created it.
https://bugzilla.gnome.org/show_bug.cgi?id=683100
libyelp/yelp-document.c | 2 +-
libyelp/yelp-view.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c
index 1a4ff0a..8794682 100644
--- a/libyelp/yelp-document.c
+++ b/libyelp/yelp-document.c
@@ -1437,7 +1437,6 @@ request_idle_error (Request *request)
callback = request->callback;
user_data = request->user_data;
error = request->error;
- request->error = NULL;
priv->reqs_pending = g_slist_remove (priv->reqs_pending, request);
}
@@ -1450,6 +1449,7 @@ request_idle_error (Request *request)
user_data,
error);
+ g_clear_error (&request->error);
g_object_unref (document);
return FALSE;
}
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index 5e21bbf..3146987 100644
--- a/libyelp/yelp-view.c
+++ b/libyelp/yelp-view.c
@@ -1634,6 +1634,7 @@ view_load_page (YelpView *view)
_("Could not load a document"));
}
view_show_error_page (view, error);
+ g_error_free (error);
return;
}
@@ -1798,7 +1799,6 @@ view_show_error_page (YelpView *view,
"UTF-8",
"file:///error/");
g_signal_handler_unblock (view, priv->navigation_requested);
- g_error_free (error);
g_free (title_m);
g_free (content_beg);
if (content_end != NULL)
@@ -2029,8 +2029,10 @@ uri_resolved (YelpUri *uri,
if (error == NULL)
view_load_page (view);
- else
+ else {
view_show_error_page (view, error);
+ g_error_free (error);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]