[evolution/gnome-3-34] EWebView: Pile calls to Web Extension proxy only when such exists
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-34] EWebView: Pile calls to Web Extension proxy only when such exists
- Date: Thu, 12 Sep 2019 14:59:45 +0000 (UTC)
commit d194e21a72431c7e210043216d4430e93184e95e
Author: Milan Crha <mcrha redhat com>
Date: Thu Sep 12 16:55:59 2019 +0200
EWebView: Pile calls to Web Extension proxy only when such exists
The callback is also called on dispose, when the EWebExtensionContainer
notifies the listeners that the proxy is no longer valid, with a NULL
argument. In this case the pile of calls doesn't make sense (and causes
runtime warnings).
Related to https://gitlab.gnome.org/GNOME/evolution/issues/587
src/e-util/e-web-view.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/e-util/e-web-view.c b/src/e-util/e-web-view.c
index c1114ef885..5caa586a6c 100644
--- a/src/e-util/e-web-view.c
+++ b/src/e-util/e-web-view.c
@@ -1842,10 +1842,12 @@ e_web_view_page_proxy_changed_cb (EWebExtensionContainer *container,
page_id == webkit_web_view_get_page_id (WEBKIT_WEB_VIEW (web_view))) {
e_web_view_set_web_extension_proxy (web_view, proxy);
- g_hash_table_foreach (web_view->priv->element_clicked_cbs,
web_view_register_element_clicked_hfunc, web_view);
+ if (proxy) {
+ g_hash_table_foreach (web_view->priv->element_clicked_cbs,
web_view_register_element_clicked_hfunc, web_view);
- e_web_view_ensure_body_class (web_view);
- style_updated_cb (web_view);
+ e_web_view_ensure_body_class (web_view);
+ style_updated_cb (web_view);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]