From 59d158d535289d7a3f0a46094766d1eaf8cbe561 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Thu, 7 Oct 1999 00:31:21 +0000 Subject: [PATCH] Work around a crash by stubbing out some pointers that are weak links that are not to be used during shutdown --- layout/base/nsPresShell.cpp | 13 +++++++++++-- layout/html/base/src/nsPresShell.cpp | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 880754044857..f0ff5a8a0276 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -506,19 +506,28 @@ PresShell::~PresShell() mIsDestroying = PR_TRUE; + // Clobber weak leaks in case of re-entrancy during tear down + mHistoryState = nsnull; + NS_IF_RELEASE(mCurrentEventContent); + if (mViewManager) { // Disable paints during tear down of the frame tree mViewManager->DisableRefresh(); + mViewManager = nsnull; } + // Destroy the frame manager before destroying the frame hierarchy. That way // we won't waste time removing content->frame mappings for frames being // destroyed NS_IF_RELEASE(mFrameManager); - if (mRootFrame) + if (mRootFrame) { mRootFrame->Destroy(*mPresContext); - if (mDocument) + } + + if (mDocument) { mDocument->DeleteShell(this); + } mRefCnt = 0; } diff --git a/layout/html/base/src/nsPresShell.cpp b/layout/html/base/src/nsPresShell.cpp index 880754044857..f0ff5a8a0276 100644 --- a/layout/html/base/src/nsPresShell.cpp +++ b/layout/html/base/src/nsPresShell.cpp @@ -506,19 +506,28 @@ PresShell::~PresShell() mIsDestroying = PR_TRUE; + // Clobber weak leaks in case of re-entrancy during tear down + mHistoryState = nsnull; + NS_IF_RELEASE(mCurrentEventContent); + if (mViewManager) { // Disable paints during tear down of the frame tree mViewManager->DisableRefresh(); + mViewManager = nsnull; } + // Destroy the frame manager before destroying the frame hierarchy. That way // we won't waste time removing content->frame mappings for frames being // destroyed NS_IF_RELEASE(mFrameManager); - if (mRootFrame) + if (mRootFrame) { mRootFrame->Destroy(*mPresContext); - if (mDocument) + } + + if (mDocument) { mDocument->DeleteShell(this); + } mRefCnt = 0; }