Clear XPCWrappedNativeScope fields to avoid accessing freed arenas during destruction, no bug. r=billm

This commit is contained in:
Brian Hackett 2011-11-14 17:06:53 -08:00
parent f30aac0eff
commit 57fdfc58fd

View File

@ -431,6 +431,9 @@ XPCWrappedNativeScope::FinishedMarkPhaseOfGC(JSContext* cx, XPCJSRuntime* rt)
if (cur->mGlobalJSObject &&
JS_IsAboutToBeFinalized(cx, cur->mGlobalJSObject)) {
cur->mGlobalJSObject = nsnull;
cur->mPrototypeJSObject = nsnull;
cur->mPrototypeJSFunction = nsnull;
cur->mPrototypeNoHelper = nsnull;
cur->mScriptObjectPrincipal = nsnull;
if (cur->GetCachedDOMPrototypes().IsInitialized())
cur->GetCachedDOMPrototypes().Clear();