From bc313ef62acffe809fe764504da8d5d4e9cbe179 Mon Sep 17 00:00:00 2001 From: "dbaron%fas.harvard.edu" Date: Sun, 3 Dec 2000 01:21:54 +0000 Subject: [PATCH] Only clear the status when setting a new document, not when clearing the old document, because clearing the old document depends on when the document viewer's destructor is called (and it could be called from within JS GC). (And fix a build warning too.) r=disttsc@bart.nl sr=brendan@mozilla.org b=61840 git-svn-id: svn://10.0.0.236/trunk@83223 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/dom/src/base/nsGlobalWindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 9eee16e1f1b..53291244781 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -141,7 +141,7 @@ GlobalWindowImpl::GlobalWindowImpl() : mTimeouts(nsnull), mTimeoutInsertionPoint(&mTimeouts), mRunningTimeout(nsnull), mTimeoutPublicIdCounter(1), mTimeoutFiringDepth(0), mFirstDocumentLoad(PR_TRUE), mGlobalObjectOwner(nsnull), mDocShell(nsnull), - mChromeEventHandler(nsnull), mMutationBits(0) + mMutationBits(0), mChromeEventHandler(nsnull) { NS_INIT_REFCNT(); if (gRefCnt++ == 0) { @@ -327,7 +327,9 @@ NS_IMETHODIMP GlobalWindowImpl::SetNewDocument(nsIDOMDocument* aDocument) When that happens, setting status isn't a big requirement, so don't. (Doesn't happen under normal circumstances, but bug 49615 describes a case.) */ - if (mDocShell) { + /* We only want to do this when we're setting a new document rather + than going away. See bug 61840. */ + if (mDocShell && aDocument) { SetStatus(nsString()); SetDefaultStatus(nsString()); }