summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docshell/base/nsDocShell.cpp4
-rw-r--r--layout/base/nsDocumentViewer.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index 0369657004..f2c7443656 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -9284,7 +9284,11 @@ nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
mContentViewer->SetNavigationTiming(mTiming);
if (NS_FAILED(mContentViewer->Init(widget, bounds))) {
+ nsCOMPtr<nsIContentViewer> viewer = mContentViewer;
+ viewer->Close(nullptr);
+ viewer->Destroy();
mContentViewer = nullptr;
+ mCurrentURI = nullptr;
NS_WARNING("ContentViewer Initialization failed");
return NS_ERROR_FAILURE;
}
diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp
index d4fcd7a77b..879f47b206 100644
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -1597,8 +1597,6 @@ DetachContainerRecurse(nsIDocShell *aShell)
NS_IMETHODIMP
nsDocumentViewer::Destroy()
{
- NS_ASSERTION(mDocument, "No document in Destroy()!");
-
#ifdef NS_PRINTING
// Here is where we check to see if the document was still being prepared
// for printing when it was asked to be destroy from someone externally