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 22:24:33 +00:00
Родитель 993990d18c
Коммит 1eb0636337
1 изменённых файлов: 4 добавлений и 0 удалений

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

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