Bug 605314 - nsBaseAppShell generates busy-wait event storm on main thread at shutdown; causing orange xpcshell tests; r=roc a=joe
authorAndrew Sutherland <bugmail@asutherland.org>
Tue, 19 Oct 2010 21:01:27 +0100
changeset 56123 5b7f550d7d9b0de2fda428e553a8c700148fea68
parent 56122 d5d273398344e52dc5e024a71600c6981f0bdd82
child 56124 c8993e15c3a547171a792044ec3fb373c51f0b49
push idunknown
push userunknown
push dateunknown
reviewersroc, joe
bugs605314
milestone2.0b8pre
Bug 605314 - nsBaseAppShell generates busy-wait event storm on main thread at shutdown; causing orange xpcshell tests; r=roc a=joe
widget/src/xpwidgets/nsBaseAppShell.cpp
--- a/widget/src/xpwidgets/nsBaseAppShell.cpp
+++ b/widget/src/xpwidgets/nsBaseAppShell.cpp
@@ -318,17 +318,17 @@ nsBaseAppShell::OnProcessNextEvent(nsITh
       break;
   }
 
   mBlockedWait = oldBlockedWait;
 
   // Make sure that the thread event queue does not block on its monitor, as
   // it normally would do if it did not have any pending events.  To avoid
   // that, we simply insert a dummy event into its queue during shutdown.
-  if (needEvent && !NS_HasPendingEvents(thr)) {  
+  if (needEvent && !mExiting && !NS_HasPendingEvents(thr)) {  
     if (!mDummyEvent)
       mDummyEvent = new nsRunnable();
     thr->Dispatch(mDummyEvent, NS_DISPATCH_NORMAL);
   }
 
   // We're about to run an event, so we're in a stable state. 
   RunSyncSections();