From 0227e2807744cce33c54e413945605ae8ffaf536 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Fri, 30 Apr 1999 00:08:17 +0000 Subject: [PATCH] Disable rendering during presentation tear down --- layout/base/nsPresShell.cpp | 10 +++++++++- layout/html/base/src/nsPresShell.cpp | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 8705a7f20c7f..c9513d8c4909 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -536,18 +536,26 @@ PresShell::QueryInterface(const nsIID& aIID, void** aInstancePtr) PresShell::~PresShell() { mRefCnt = 99;/* XXX hack! get around re-entrancy bugs */ + mIsDestroying = PR_TRUE; + if (mViewManager) { + // Disable paints during tear down of the frame tree + mViewManager->DisableRefresh(); + } if (nsnull != mRootFrame) { mRootFrame->DeleteFrame(*mPresContext); } NS_IF_RELEASE(mViewManager); - //Release mPresContext after mViewManager + + //Note: Release mPresContext after mViewManager + // XXX why? NS_IF_RELEASE(mPresContext); NS_IF_RELEASE(mStyleSet); if (nsnull != mDocument) { mDocument->DeleteShell(this); NS_RELEASE(mDocument); } + mRefCnt = 0; delete mPlaceholderMap; } diff --git a/layout/html/base/src/nsPresShell.cpp b/layout/html/base/src/nsPresShell.cpp index 8705a7f20c7f..c9513d8c4909 100644 --- a/layout/html/base/src/nsPresShell.cpp +++ b/layout/html/base/src/nsPresShell.cpp @@ -536,18 +536,26 @@ PresShell::QueryInterface(const nsIID& aIID, void** aInstancePtr) PresShell::~PresShell() { mRefCnt = 99;/* XXX hack! get around re-entrancy bugs */ + mIsDestroying = PR_TRUE; + if (mViewManager) { + // Disable paints during tear down of the frame tree + mViewManager->DisableRefresh(); + } if (nsnull != mRootFrame) { mRootFrame->DeleteFrame(*mPresContext); } NS_IF_RELEASE(mViewManager); - //Release mPresContext after mViewManager + + //Note: Release mPresContext after mViewManager + // XXX why? NS_IF_RELEASE(mPresContext); NS_IF_RELEASE(mStyleSet); if (nsnull != mDocument) { mDocument->DeleteShell(this); NS_RELEASE(mDocument); } + mRefCnt = 0; delete mPlaceholderMap; }