Unset and reset the JS context global objects when doing ExplainLiveExpectedGarbage, just like when doing normal cycle collection. b=410116 r+sr=peterv Not part of default build (DEBUG_CC-only).

This commit is contained in:
dbaron@dbaron.org 2008-01-11 14:24:33 -08:00
Родитель 58d61560c6
Коммит 20be15cd34
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -606,6 +606,8 @@ nsXPConnect::BeginCycleCollection(nsCycleCollectionTraversalCallback &cb)
return NS_ERROR_OUT_OF_MEMORY;
}
nsXPConnect::GetRuntime()->UnsetContextGlobals();
PRBool alreadyCollecting = mCycleCollecting;
mCycleCollecting = PR_TRUE;
NoteJSRootTracer trc(&mJSRoots, cb);
@ -650,6 +652,8 @@ nsXPConnect::FinishCycleCollection()
{
mCycleCollectionContext = nsnull;
mExplainCycleCollectionContext = nsnull;
nsXPConnect::GetRuntime()->RestoreContextGlobals();
}
#endif