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.
This commit is contained in:
Vincent Sanders 2015-03-06 17:09:50 +00:00
parent 5d3cc513a3
commit c4e551cd0c
1 changed files with 8 additions and 0 deletions

View File

@ -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);
}