Fix crash when JS context is required from a frame.

This commit is contained in:
Michael Drake 2015-08-13 09:39:04 +01:00
parent 526b0e3bb4
commit 2d53524635
1 changed files with 6 additions and 5 deletions

View File

@ -794,11 +794,6 @@ nserror browser_window_create(enum browser_window_create_flags flags,
return NSERROR_NOMEM;
}
/* new javascript context for window */
ret->jsctx = js_newcontext(nsoption_int(script_timeout),
slow_script,
NULL);
/* Initialise common parts */
err = browser_window_initialise_common(flags, ret, existing);
if (err != NSERROR_OK) {
@ -858,6 +853,12 @@ nserror browser_window_initialise_common(enum browser_window_create_flags flags,
nserror err;
assert(bw);
/* new javascript context for each window/frame
* TODO: is this correct? */
bw->jsctx = js_newcontext(nsoption_int(script_timeout),
slow_script,
NULL);
if (flags & BW_CREATE_CLONE) {
assert(existing != NULL);