Added deathgrip to outing content viewer to ensure it didn't get destroyed by JS garbage collection. b=71515, sr=rpotts@netscape.com, r=brendan@mozilla.org

git-svn-id: svn://10.0.0.236/trunk@93268 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
locka%iol.ie
2001-04-27 11:17:30 +00:00
parent 8937c09f7c
commit 3fb0213bde

View File

@@ -1764,8 +1764,6 @@ NS_IMETHODIMP nsDocShell::Destroy()
mScriptContext = nsnull;
}
mScriptGlobal = nsnull;
mScriptContext = nsnull;
mSessionHistory = nsnull;
SetTreeOwner(nsnull);
@@ -3041,6 +3039,8 @@ NS_IMETHODIMP nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
nscolor bgcolor = NS_RGBA(0, 0, 0, 0);
PRBool bgSet = PR_FALSE;
// Ensure that the content viewer is destroyed *after* the GC - bug 71515
nsCOMPtr<nsIContentViewer> kungfuDeathGrip = mContentViewer;
if (mContentViewer) {
// Stop any activity that may be happening in the old document before
// releasing it...
@@ -3069,7 +3069,8 @@ NS_IMETHODIMP nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
mContentViewer = nsnull;
}
// End copying block (Don't hold content/document viewer ref beyond here!!)
// End copying block (Don't mess with the old content/document viewer
// beyond here!!)
// See the book I wrote above regarding why the focus controller is
// being used here. -- hyatt