From 1ece5d5eba91ca2cba9b3b5dfd4c70323f1a0e4e Mon Sep 17 00:00:00 2001 From: "nisheeth%netscape.com" Date: Thu, 10 Feb 2000 07:27:43 +0000 Subject: [PATCH] r=vidur. Fix for bug . We now revoke pending reflow events in the pres shell's destructor. git-svn-id: svn://10.0.0.236/trunk@60301 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsPresShell.cpp | 8 +++++++- mozilla/layout/html/base/src/nsPresShell.cpp | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 8ba7c6ab4c5..cce8b3b28f1 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -715,6 +715,12 @@ PresShell::~PresShell() mViewEventListener->SetPresShell((nsIPresShell*)nsnull); NS_RELEASE(mViewEventListener); } + + // Revoke pending reflow events + if (mPendingReflowEvent) { + mPendingReflowEvent = PR_FALSE; + mEventQueue->RevokeEvents(this); + } } /** @@ -1875,7 +1881,7 @@ ReflowEvent::ReflowEvent(nsIPresShell* aPresShell, nsIEventQueue* aQueue) mPresShell = getter_AddRefs(NS_GetWeakReference(aPresShell)); - PL_InitEvent(this, nsnull, + PL_InitEvent(this, aPresShell, (PLHandleEventProc) ::HandlePLEvent, (PLDestroyEventProc) ::DestroyPLEvent); diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 8ba7c6ab4c5..cce8b3b28f1 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -715,6 +715,12 @@ PresShell::~PresShell() mViewEventListener->SetPresShell((nsIPresShell*)nsnull); NS_RELEASE(mViewEventListener); } + + // Revoke pending reflow events + if (mPendingReflowEvent) { + mPendingReflowEvent = PR_FALSE; + mEventQueue->RevokeEvents(this); + } } /** @@ -1875,7 +1881,7 @@ ReflowEvent::ReflowEvent(nsIPresShell* aPresShell, nsIEventQueue* aQueue) mPresShell = getter_AddRefs(NS_GetWeakReference(aPresShell)); - PL_InitEvent(this, nsnull, + PL_InitEvent(this, aPresShell, (PLHandleEventProc) ::HandlePLEvent, (PLDestroyEventProc) ::DestroyPLEvent);