From d90897cc8a91099c884b9a11b1063463971f65e9 Mon Sep 17 00:00:00 2001 From: "danm%netscape.com" Date: Tue, 1 Aug 2000 01:16:40 +0000 Subject: [PATCH] Glossing over the real problem (a leaking content area docshell), in the sure hope that nsBrowserInstance is going away soon, this embarrassing hack stops crash bug 46556. Same change is on M17, rev 1.139.2.4. r=hyatt --- xpfe/browser/src/nsBrowserInstance.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/xpfe/browser/src/nsBrowserInstance.cpp b/xpfe/browser/src/nsBrowserInstance.cpp index 0e69d61cced..adde42af926 100644 --- a/xpfe/browser/src/nsBrowserInstance.cpp +++ b/xpfe/browser/src/nsBrowserInstance.cpp @@ -29,6 +29,7 @@ // Interfaces Needed #include "nsIXULWindow.h" +#include "nsIBaseWindow.h" #include "nsIDocShell.h" #include "nsIDocShellTreeItem.h" #include "nsISHistory.h" @@ -404,6 +405,17 @@ nsIDocShell* nsBrowserInstance::GetContentAreaDocShell() { nsCOMPtr docShell(do_QueryReferent(mContentAreaDocShellWeak)); + if (docShell) { + // the docshell still exists, but has it been destroyed? + nsCOMPtr hack = do_QueryInterface(docShell); + if (hack) { + nsCOMPtr parent; + hack->GetParentWidget(getter_AddRefs(parent)); + if (!parent) + // it's a zombie. a new one is in place. set up to use it. + docShell = 0; + } + } if (!docShell) ReinitializeContentVariables(); docShell = do_QueryReferent(mContentAreaDocShellWeak); @@ -419,7 +431,7 @@ nsBrowserInstance::GetContentWindow() domWindow = do_QueryReferent(mContentWindowWeak); return domWindow.get(); } - + nsIDocumentLoader* nsBrowserInstance::GetContentAreaDocLoader() {