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

git-svn-id: svn://10.0.0.236/trunk@64824 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jband%netscape.com 2000-04-01 00:33:10 +00:00
parent 5071419800
commit cb6bfbdb6e

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;