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 31a7d5b91e
commit 52d6223768

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();