From 5f1022d223ab3c0b3dbbb4dc60c52b4af252cf1f Mon Sep 17 00:00:00 2001 From: "rpotts%netscape.com" Date: Fri, 8 Sep 2000 00:29:13 +0000 Subject: [PATCH] bug #37434. Stop() is now called on the content viewer, before the old document is destroyed. This allows the old document to release some stuff :-) git-svn-id: svn://10.0.0.236/trunk@78453 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 6 ++++++ mozilla/docshell/base/nsWebShell.cpp | 16 ---------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 6b6b027af99..03a707ea935 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -2618,6 +2618,12 @@ NS_IMETHODIMP nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer) NS_ERROR_FAILURE); } } + + // Stop any activity that may be happening in the old document before + // releasing it... + if (mContentViewer) { + mContentViewer->Stop(); + } mContentViewer = nsnull; // End copying block (Don't hold content/document viewer ref beyond here!!) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 6f6c61c5baf..7b8a3898c4a 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -1162,22 +1162,6 @@ NS_IMETHODIMP nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel) { - nsresult rv; - - nsCOMPtr aURL; - rv = channel->GetURI(getter_AddRefs(aURL)); - if (NS_FAILED(rv)) return rv; - - - // Stop loading of the earlier document completely when the document url - // load starts. Now we know that this url is valid and available. - nsLoadFlags loadFlags = 0; - channel -> GetLoadAttributes (&loadFlags); - - PRBool equals = PR_FALSE; - if (NS_SUCCEEDED(aURL->Equals(mCurrentURI, &equals)) && equals && !(loadFlags & nsIChannel::LOAD_REPLACE)) - Stop(); - /* *Fire the OnStartDocumentLoad of the webshell observer */