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);