commit 7ae181d459f1bea342f698c7f3daf33170a7b5d7
parent e3011638e20a5129e41d016b75d3a2af08b7b164
Author: Vincent Hilla <vhilla@mozilla.com>
Date: Wed, 26 Nov 2025 15:32:26 +0000
Bug 2002128 - Clear nsFrameLoader::mDocShell if create fails due to no window. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D274105
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp
@@ -2231,6 +2231,10 @@ nsresult nsFrameLoader::MaybeCreateDocShell() {
if (NS_WARN_IF(!newWindow)) {
// Do not call Destroy() here. See bug 472312.
NS_WARNING("Something wrong when creating the docshell for a frameloader!");
+ // The docshell isn't completely initialized. Clear it so that it isn't
+ // reachable. Future calls to MaybeCreateDocShell will fail due to
+ // mInitialized.
+ mDocShell = nullptr;
return NS_ERROR_FAILURE;
}