author | Blake Kaplan <mrbkap@gmail.com> |
Mon, 25 Oct 2010 12:13:36 -0700 | |
changeset 56590 | 85fb4bc01a71280917787f30ed59bd551e503476 |
parent 56589 | 0e22005f6e4fcd6516a2cc8bc4a5037780dfcddf |
child 56591 | 9a1a2c464ac29ea7614739655604e0d6ea79f431 |
push id | 16602 |
push user | rsayre@mozilla.com |
push date | Wed, 27 Oct 2010 01:10:03 +0000 |
treeherder | mozilla-central@7b83033bb6f8 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jst |
bugs | 605696 |
milestone | 2.0b8pre |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -7090,25 +7090,23 @@ nsLocationSH::PreCreate(nsISupports *nat nsLocation *loc = (nsLocation *)safeLoc.get(); nsIDocShell *ds = loc->GetDocShell(); if (!ds) { NS_WARNING("Refusing to create a location in the wrong scope"); return NS_ERROR_UNEXPECTED; } nsCOMPtr<nsIScriptGlobalObject> sgo = do_GetInterface(ds); - - if (sgo) { - JSObject *global = sgo->GetGlobalJSObject(); - - if (global) { - *parentObj = global; - } - } - + if (!sgo) { + NS_WARNING("Refusing to create a location in the wrong scope because the " + "docshell is being destroyed"); + return NS_ERROR_UNEXPECTED; + } + + *parentObj = sgo->GetGlobalJSObject(); return NS_OK; } // DOM Navigator helper nsresult nsNavigatorSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj, JSObject **parentObj) {