diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 28f217d125fc..cc23d995321c 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -5430,7 +5430,7 @@ ContentParent::RecvCreateWindow(PBrowserParent* aThisTab, // Opening new tabs is the easy case... if (openLocation == nsIBrowserDOMWindow::OPEN_NEWTAB) { if (NS_WARN_IF(!browserDOMWin)) { - *aResult = NS_ERROR_FAILURE; + *aResult = NS_ERROR_ABORT; return true; } diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index a700293ac9b5..7c5f092c04a9 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -606,6 +606,10 @@ TabParent::DestroyInternal() void TabParent::Destroy() { + // Aggressively release the window to avoid leaking the world in shutdown + // corner cases. + mBrowserDOMWindow = nullptr; + if (mIsDestroyed) { return; }