mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Checkin in part of the fix for nsbeta3+ bug 42321. Avoid running JS_GC() many times per window open/close, once should be enough. Patch mostly done by alex@cendio.se, r=jst@netscape.com & vidur@netscape.com
This commit is contained in:
parent
76a1bda8a7
commit
6fc361e1b1
@ -2683,9 +2683,6 @@ NS_IMETHODIMP nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
|
||||
if (commandDispatcher)
|
||||
commandDispatcher->SetSuppressFocus(PR_FALSE);
|
||||
|
||||
if(mScriptContext)
|
||||
mScriptContext->GC();
|
||||
|
||||
mContentViewer = aNewViewer;
|
||||
|
||||
nsCOMPtr<nsIWidget> widget;
|
||||
|
@ -269,7 +269,9 @@ NS_IMETHODIMP GlobalWindowImpl::SetNewDocument(nsIDOMDocument* aDocument)
|
||||
(JSObject *) mScriptObject);
|
||||
|
||||
if (mFirstDocumentLoad) {
|
||||
mFirstDocumentLoad = PR_FALSE;
|
||||
if (aDocument)
|
||||
mFirstDocumentLoad = PR_FALSE;
|
||||
|
||||
mDocument = aDocument;
|
||||
return NS_OK;
|
||||
}
|
||||
@ -321,7 +323,7 @@ NS_IMETHODIMP GlobalWindowImpl::SetNewDocument(nsIDOMDocument* aDocument)
|
||||
mDocument = nsnull; // Forces Release
|
||||
}
|
||||
|
||||
if (mContext) {
|
||||
if (mContext && aDocument) {
|
||||
// Add an extra ref in case we release mContext during GC.
|
||||
nsCOMPtr<nsIScriptContext> kungFuDeathGrip = mContext;
|
||||
kungFuDeathGrip->GC();
|
||||
|
Loading…
Reference in New Issue
Block a user