diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 2ec70bcd953..001bd0e24e8 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -808,24 +808,33 @@ nsWebShell::Embed(nsIContentViewer* aContentViewer, ("nsWebShell::Embed: this=%p aDocViewer=%p aCommand=%s aExtraInfo=%p", this, aContentViewer, aCommand ? aCommand : "", aExtraInfo)); -/* nsCOMPtr oldMUDV; + // + // Copy content viewer state from previous or parent content viewer. // // The following logic is mirrored in nsHTMLDocument::StartDocumentLoad! // - if (mContentViewer) // && (eCharsetReloadInit!=mCharsetReloadState)) - { // get any interesting state from the old content viewer - // XXX: it would be far better to just reuse the document viewer , - // since we know we're just displaying the same document as before - oldMUDV = do_QueryInterface(mContentViewer); - } - else - { // If we don't have an old content viewer, get state from our parent - // in this block of code, if we get an error result, we return it - // but if we get a null pointer, that's perfectly legal for parent and parentContentViewer - nsCOMPtr parent; - rv = GetParent(*getter_AddRefs(parent)); - if (NS_FAILED(rv)) { return rv; } - if (parent) { + // Do NOT to maintain a reference to the old content viewer outside + // of this "copying" block, or it will not be destroyed until the end of + // this routine and all