hold an extra ref on mContext while we are calling GC. a=leaf to checkin while tree is closed

This commit is contained in:
jband%netscape.com 2000-04-01 00:33:10 +00:00
parent 89f8378252
commit 7d198d2117

View File

@ -253,7 +253,11 @@ NS_IMETHODIMP GlobalWindowImpl::SetNewDocument(nsIDOMDocument *aDocument)
mDocument = nsnull; // Forces Release
if(mContext)
mContext->GC();
{
// Add an extra ref in case we release mContext during GC.
nsCOMPtr<nsIScriptContext> kungFuDeathGrip = mContext;
kungFuDeathGrip->GC();
}
mDocument = aDocument;