Followup for bug 534341 (XPConnect should not unroot globals of non-main thread contexts). r=bent, sr=jst.

--HG--
extra : rebase_source : 1a21a5b4646b0d1bd4b2a20bbbe460bba7fc78fc
This commit is contained in:
Peter Van der Beken 2010-01-13 14:50:01 +01:00
parent 48bc8e7aca
commit 812feed9d8
2 changed files with 1 additions and 6 deletions

View File

@ -444,7 +444,7 @@ void XPCJSRuntime::UnrootContextGlobals()
{
NS_ASSERTION(!JS_HAS_OPTION(acx, JSOPTION_UNROOTED_GLOBAL),
"unrooted global should be set only during CC");
if(XPCPerThreadData::IsMainThreadContext(acx) &&
if(XPCPerThreadData::IsMainThread(acx) &&
nsXPConnect::GetXPConnect()->GetRequestDepth(acx) == 0)
{
JS_ClearNewbornRoots(acx);

View File

@ -3441,11 +3441,6 @@ public:
return GetDataImpl(cx);
}
static inline JSBool IsMainThreadContext(JSContext *cx)
{
return cx->thread == sMainJSThread;
}
static void CleanupAllThreads();
~XPCPerThreadData();