diff --git a/mozilla/xpcom/threads/nsEventQueue.cpp b/mozilla/xpcom/threads/nsEventQueue.cpp index 30d7775d762..eeaaf3469e2 100644 --- a/mozilla/xpcom/threads/nsEventQueue.cpp +++ b/mozilla/xpcom/threads/nsEventQueue.cpp @@ -386,6 +386,12 @@ nsEventQueueImpl::ProcessPendingEvents() } #endif PL_ProcessPendingEvents(mEventQueue); + + // if we're no longer accepting events and there are still events in the + // queue, then process remaining events. + if (!mAcceptingEvents && PL_EventAvailable(mEventQueue)) + PL_ProcessPendingEvents(mEventQueue); + CheckForDeactivation(); if (mElderQueue) { diff --git a/mozilla/xpcom/threads/nsEventQueueService.cpp b/mozilla/xpcom/threads/nsEventQueueService.cpp index 5226cb6e468..95aef9ea47e 100644 --- a/mozilla/xpcom/threads/nsEventQueueService.cpp +++ b/mozilla/xpcom/threads/nsEventQueueService.cpp @@ -331,6 +331,7 @@ nsEventQueueServiceImpl::PopThreadEventQueue(nsIEventQueue *aQueue) ++gEventQueueLogCount; #endif aQueue->StopAcceptingEvents(); + aQueue->ProcessPendingEvents(); // make sure we don't orphan any events if (aQueue == queue.get()) { // are we reomving the eldest queue? mEventQTable.Remove(&key); // remove nsIEventQueue from hash table (releases)