mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
GlobalWindowImpl::SetNewDocument: fixed multiple initialization of JSContext. Always clears the scope first.
This commit is contained in:
parent
65b1f8f077
commit
c9f141a9a0
@ -213,19 +213,18 @@ GlobalWindowImpl::SetContext(nsIScriptContext *aContext)
|
||||
NS_IMETHODIMP_(void)
|
||||
GlobalWindowImpl::SetNewDocument(nsIDOMDocument *aDocument)
|
||||
{
|
||||
if (nsnull != mDocument) {
|
||||
ClearAllTimeouts();
|
||||
ClearAllTimeouts();
|
||||
|
||||
if (nsnull != mScriptObject && nsnull != mContext) {
|
||||
JS_ClearScope((JSContext *)mContext->GetNativeContext(),
|
||||
(JSObject *)mScriptObject);
|
||||
}
|
||||
|
||||
NS_RELEASE(mDocument);
|
||||
if (nsnull != mContext) {
|
||||
mContext->GC();
|
||||
}
|
||||
if (nsnull != mScriptObject && nsnull != mContext) {
|
||||
JS_ClearScope((JSContext *)mContext->GetNativeContext(),
|
||||
(JSObject *)mScriptObject);
|
||||
}
|
||||
|
||||
if (nsnull != mDocument)
|
||||
NS_RELEASE(mDocument);
|
||||
|
||||
if (nsnull != mContext)
|
||||
mContext->GC();
|
||||
|
||||
mDocument = aDocument;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user