[epiphany] web-process-extension: Fix js context leak



commit 50c3a5b2df8615ec683b91000c89add835de81cd
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Tue May 28 10:42:26 2019 +0200

    web-process-extension: Fix js context leak
    
    webkit_frame_get_js_context_for_script_world() is transfer full, but a
    bug in WebKit caused a crash when not leaking the context. The bug was
    fixed in WebKit 2.25.1, so fix the leak only for newer WebKit versions.
    We can remove the check once we can bump the WebKit requirements.

 embed/web-process-extension/ephy-web-process-extension.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/embed/web-process-extension/ephy-web-process-extension.c 
b/embed/web-process-extension/ephy-web-process-extension.c
index 649372a70..2de3da238 100644
--- a/embed/web-process-extension/ephy-web-process-extension.c
+++ b/embed/web-process-extension/ephy-web-process-extension.c
@@ -700,7 +700,12 @@ window_object_cleared_cb (WebKitScriptWorld        *world,
                           WebKitFrame              *frame,
                           EphyWebProcessExtension  *extension)
 {
-  JSCContext *js_context;
+  /* FIXME: remove this check once we bump WebKit dependency */
+#if WEBKIT_CHECK_VERSION(2, 25, 1)
+  g_autoptr(JSCContext) js_context = NULL;
+#else
+  JSCContext *js_context:
+#endif
   g_autoptr(GBytes) bytes = NULL;
   const char* data;
   gsize data_size;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]