зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1730120, close ContentViewer properly if initialization fails, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D130211
This commit is contained in:
Родитель
eaeec96d4b
Коммит
91122391ce
|
@ -8107,7 +8107,11 @@ nsresult nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer,
|
||||||
mContentViewer->SetNavigationTiming(mTiming);
|
mContentViewer->SetNavigationTiming(mTiming);
|
||||||
|
|
||||||
if (NS_FAILED(mContentViewer->Init(widget, bounds, aWindowActor))) {
|
if (NS_FAILED(mContentViewer->Init(widget, bounds, aWindowActor))) {
|
||||||
|
nsCOMPtr<nsIContentViewer> viewer = mContentViewer;
|
||||||
|
viewer->Close(nullptr);
|
||||||
|
viewer->Destroy();
|
||||||
mContentViewer = nullptr;
|
mContentViewer = nullptr;
|
||||||
|
mCurrentURI = nullptr;
|
||||||
NS_WARNING("ContentViewer Initialization failed");
|
NS_WARNING("ContentViewer Initialization failed");
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1597,8 +1597,6 @@ static void DetachContainerRecurse(nsIDocShell* aShell) {
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDocumentViewer::Destroy() {
|
nsDocumentViewer::Destroy() {
|
||||||
NS_ASSERTION(mDocument, "No document in Destroy()!");
|
|
||||||
|
|
||||||
// Don't let the document get unloaded while we are printing.
|
// Don't let the document get unloaded while we are printing.
|
||||||
// this could happen if we hit the back button during printing.
|
// this could happen if we hit the back button during printing.
|
||||||
// We also keep the viewer from being cached in session history, since
|
// We also keep the viewer from being cached in session history, since
|
||||||
|
|
Загрузка…
Ссылка в новой задаче