Fix for bug 494290 (Crash [@ nsJSContext::cycleCollection::Traverse]). r/sr=jst.

--HG--
extra : rebase_source : e84f31938e62a00f163ff705b7ce5a58da9b8dd4
This commit is contained in:
Peter Van der Beken 2009-05-22 20:45:26 +02:00
parent 464859edf2
commit f5c089b7a2

View File

@ -1365,7 +1365,10 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE_AMBIGUOUS(nsJSContext, nsIScriptContext)
nsrefcnt
nsJSContext::GetCCRefcnt()
{
return mRefCnt.get() + mContext->outstandingRequests;
nsrefcnt refcnt = mRefCnt.get();
if (NS_LIKELY(mContext))
refcnt += mContext->outstandingRequests;
return refcnt;
}
nsresult