From c4e551cd0cecf4ec9aba2d033cba3ca97e669463 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 6 Mar 2015 17:09:50 +0000 Subject: clear the html content reference to javascript context. When the browser window is about to be destroyed html_close gets called indicating the browser_window previously associated with the html content is about to become invalid. This makes the javascript context invalid within the html content (it is held by the browser window) when that context is about to be destroyed. Previously the javascript children would continue to attempt to use the context after it had been destroyed causing all sorts of strange errors and failures. --- render/html.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/render/html.c b/render/html.c index f3667d470..d1a61a4f3 100644 --- a/render/html.c +++ b/render/html.c @@ -1538,8 +1538,16 @@ static void html_close(struct content *c) if (html->search != NULL) search_destroy_context(html->search); + /* clear the html content reference to the browser window */ html->bw = NULL; + /* clear the html content reference to the javascript context + * as it is about to become invalid and must not be used any + * more. + */ + html->jscontext = NULL; + + /* remove all object references from teh html content */ html_object_close_objects(html); } -- cgit v1.2.3