mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-09 21:33:43 +00:00
Fix for bug 402535 (Cycle collection crashes with Leak Monitor extension installed). Pending-r=sicking, sr=jst, a=dsicore.
This commit is contained in:
parent
f25d1acc8d
commit
7d616bf099
@ -454,15 +454,19 @@ void XPCJSRuntime::UnsetContextGlobals()
|
||||
if(nsXPConnect::GetXPConnect()->GetRequestDepth(acx) == 0)
|
||||
{
|
||||
JS_ClearNewbornRoots(acx);
|
||||
JSDHashEntryHdr* entry =
|
||||
JS_DHashTableOperate(&mClearedGlobalObjects, acx, JS_DHASH_ADD);
|
||||
ClearedGlobalObject* clearedGlobal =
|
||||
reinterpret_cast<ClearedGlobalObject*>(entry);
|
||||
if(clearedGlobal)
|
||||
if(acx->globalObject)
|
||||
{
|
||||
clearedGlobal->mContext = acx;
|
||||
clearedGlobal->mGlobalObject = acx->globalObject;
|
||||
acx->globalObject = nsnull;
|
||||
JSDHashEntryHdr* entry =
|
||||
JS_DHashTableOperate(&mClearedGlobalObjects, acx,
|
||||
JS_DHASH_ADD);
|
||||
ClearedGlobalObject* clearedGlobal =
|
||||
reinterpret_cast<ClearedGlobalObject*>(entry);
|
||||
if(clearedGlobal)
|
||||
{
|
||||
clearedGlobal->mContext = acx;
|
||||
clearedGlobal->mGlobalObject = acx->globalObject;
|
||||
acx->globalObject = nsnull;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user