Issue #2452 - Declare the NS_ERROR_DOCSHELL_DYING error

From https://bugzilla.mozilla.org/show_bug.cgi?id=1337537
This commit is contained in:
Martok 2024-01-14 21:48:08 +01:00 committed by roytam1
commit 728b8ad60b
3 changed files with 10 additions and 1 deletions

View file

@ -9040,6 +9040,12 @@ nsDocShell::CreateContentViewer(const nsACString& aContentType,
{
*aContentHandler = nullptr;
if (!mTreeOwner) {
// If we don't have a tree owner, then we're in the process of being
// destroyed. Rather than continue trying to load something, just give up.
return NS_ERROR_DOCSHELL_DYING;
}
// Can we check the content type of the current content viewer
// and reuse it without destroying it and re-creating it?