Bug 579782 - Deal with a null context when closing the window. r=jst

--HG--
extra : rebase_source : d74e368d3a834fa47b6d912d35f0d9c6a0d60b7b
This commit is contained in:
Blake Kaplan 2010-07-21 17:17:35 -07:00
parent d91d792e4c
commit 97dcf454d5

View File

@ -2167,7 +2167,9 @@ nsGlobalWindow::SetDocShell(nsIDocShell* aDocShell)
mDoc = nsnull;
}
mContext->ClearScope(mJSObject, PR_TRUE);
if (mContext) {
mContext->ClearScope(mJSObject, PR_TRUE);
}
ClearControllers();
@ -2181,9 +2183,11 @@ nsGlobalWindow::SetDocShell(nsIDocShell* aDocShell)
mArgumentsOrigin = nsnull;
}
mContext->GC();
mContext->FinalizeContext();
mContext = nsnull;
if (mContext) {
mContext->GC();
mContext->FinalizeContext();
mContext = nsnull;
}
#ifdef DEBUG
nsCycleCollector_DEBUG_shouldBeFreed(mContext);