[evolution/gnome-3-24] Fix runtime warning on close from e_content_request_process()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-24] Fix runtime warning on close from e_content_request_process()
- Date: Mon, 3 Jul 2017 13:59:44 +0000 (UTC)
commit 7330ddf1ebdaaa4408392fed7c15dce2bbd67216
Author: Milan Crha <mcrha redhat com>
Date: Mon Jul 3 15:54:15 2017 +0200
Fix runtime warning on close from e_content_request_process()
Namely this one:
evolution-util-CRITICAL **: e_content_request_process: assertion 'G_IS_OBJECT (requester)' failed
which could show up on close. The 'requester' had been NULL, thus
it caused no harm in memory, but it is still better to cancel
the request gracefully, than claim on the console.
src/e-util/e-web-view.c | 10 ++++++++++
src/modules/webkit-editor/e-webkit-editor.c | 10 ++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/e-util/e-web-view.c b/src/e-util/e-web-view.c
index 361b14d..44c767d 100644
--- a/src/e-util/e-web-view.c
+++ b/src/e-util/e-web-view.c
@@ -1086,6 +1086,16 @@ web_view_process_uri_request_cb (WebKitURISchemeRequest *request,
uri = webkit_uri_scheme_request_get_uri (request);
requester = G_OBJECT (webkit_uri_scheme_request_get_web_view (request));
+ if (!requester) {
+ GError *error;
+
+ error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, "Cancelled");
+ webkit_uri_scheme_request_finish_error (request, error);
+ g_clear_error (&error);
+
+ return;
+ }
+
g_return_if_fail (e_content_request_can_process_uri (content_request, uri));
if (E_IS_WEB_VIEW (requester)) {
diff --git a/src/modules/webkit-editor/e-webkit-editor.c b/src/modules/webkit-editor/e-webkit-editor.c
index 77fa0fe..4ec4583 100644
--- a/src/modules/webkit-editor/e-webkit-editor.c
+++ b/src/modules/webkit-editor/e-webkit-editor.c
@@ -5036,6 +5036,16 @@ webkit_editor_process_uri_request_cb (WebKitURISchemeRequest *request,
uri = webkit_uri_scheme_request_get_uri (request);
requester = G_OBJECT (webkit_uri_scheme_request_get_web_view (request));
+ if (!requester) {
+ GError *error;
+
+ error = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, "Cancelled");
+ webkit_uri_scheme_request_finish_error (request, error);
+ g_clear_error (&error);
+
+ return;
+ }
+
g_return_if_fail (e_content_request_can_process_uri (content_request, uri));
e_content_request_process (content_request, uri, requester, NULL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]