diff --git a/xpfe/browser/src/nsBrowserInstance.cpp b/xpfe/browser/src/nsBrowserInstance.cpp index 683a1bab3600..399866ddd466 100644 --- a/xpfe/browser/src/nsBrowserInstance.cpp +++ b/xpfe/browser/src/nsBrowserInstance.cpp @@ -480,8 +480,8 @@ nsBrowserInstance::ReinitializeContentVariables() nsresult nsBrowserInstance::GetContentAreaDocShell(nsIDocShell** outDocShell) { nsCOMPtr docShell(do_QueryReferent(mContentAreaDocShellWeak)); - if (docShell) { - // the docshell still exists, but has it been destroyed? + if (!mIsClosed && docShell) { + // we're still alive and the docshell still exists. but has it been destroyed? nsCOMPtr hack = do_QueryInterface(docShell); if (hack) { nsCOMPtr parent; @@ -491,7 +491,7 @@ nsresult nsBrowserInstance::GetContentAreaDocShell(nsIDocShell** outDocShell) docShell = 0; } } - if (!docShell) + if (!mIsClosed && !docShell) ReinitializeContentVariables(); docShell = do_QueryReferent(mContentAreaDocShellWeak);