Revoke pending reflow events before tearing down the frame tree. Bug 347662,

r+sr=dbaron, a=dveditz


git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_0_BRANCH@215910 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2006-11-27 22:29:40 +00:00
parent 97adcb172a
commit d58c94b660

View File

@@ -1975,6 +1975,18 @@ PresShell::Destroy()
mDocument->DeleteShell(this);
}
// Revoke pending events. We need to do this and cancel reflow commands
// before we destroy the frame manager, since apparently frame destruction
// sometimes spins the event queue when plug-ins are involved(!).
mPostedReplaces = nsnull;
mReflowEventQueue = nsnull;
nsCOMPtr<nsIEventQueue> eventQueue;
mEventQueueService->GetSpecialEventQueue(nsIEventQueueService::UI_THREAD_EVENT_QUEUE,
getter_AddRefs(eventQueue));
eventQueue->RevokeEvents(this);
CancelAllReflowCommands();
// Destroy the frame manager. This will destroy the frame hierarchy
mFrameConstructor->WillDestroyFrameTree();
FrameManager()->Destroy();
@@ -2009,16 +2021,6 @@ PresShell::Destroy()
NS_RELEASE(mViewEventListener);
}
// Revoke pending events
mPostedReplaces = nsnull;
mReflowEventQueue = nsnull;
nsCOMPtr<nsIEventQueue> eventQueue;
mEventQueueService->GetSpecialEventQueue(nsIEventQueueService::UI_THREAD_EVENT_QUEUE,
getter_AddRefs(eventQueue));
eventQueue->RevokeEvents(this);
CancelAllReflowCommands();
RemoveDummyLayoutRequest();
KillResizeEventTimer();