From 20be15cd34e5c664afab18c7e8d9e12e927a743a Mon Sep 17 00:00:00 2001 From: "dbaron@dbaron.org" Date: Fri, 11 Jan 2008 14:24:33 -0800 Subject: [PATCH] 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). --- js/src/xpconnect/src/nsXPConnect.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/src/xpconnect/src/nsXPConnect.cpp b/js/src/xpconnect/src/nsXPConnect.cpp index 15043b0bf5c..46eed6e00ef 100644 --- a/js/src/xpconnect/src/nsXPConnect.cpp +++ b/js/src/xpconnect/src/nsXPConnect.cpp @@ -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