Bug 303484. Limit the nesting of modal event loops so we avoid overflowing the C++ stack. r+sr=brendan,a=asa

git-svn-id: svn://10.0.0.236/trunk@177889 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
roc+%cs.cmu.edu
2005-08-16 21:03:12 +00:00
parent 42f00e91b7
commit 57bffe2488
3 changed files with 47 additions and 34 deletions

View File

@@ -296,20 +296,24 @@ nsEventQueueServiceImpl::PushThreadEventQueue(nsIEventQueue **aNewQueue)
mEventQTable.Put(currentThread, newQueue);
}
// append to the event queue chain -- QI the queue in the hash table
nsCOMPtr<nsPIEventQueueChain> ourChain(do_QueryInterface(queue));
// append to the event queue chain -- QI the queue in the hash table
nsCOMPtr<nsPIEventQueueChain> ourChain(do_QueryInterface(queue));
if (ourChain)
ourChain->AppendQueue(newQueue); // append new queue to it
rv = ourChain->AppendQueue(newQueue); // append new queue to it
*aNewQueue = newQueue;
if (NS_FAILED(rv)) {
NS_RELEASE(newQueue);
} else {
*aNewQueue = newQueue;
#if defined(PR_LOGGING) && defined(DEBUG_danm)
PLEventQueue *equeue;
(*aNewQueue)->GetPLEventQueue(&equeue);
PR_LOG(gEventQueueLog, PR_LOG_DEBUG,
("EventQueue: Service push queue [queue=%lx]",(long)equeue));
++gEventQueueLogCount;
PLEventQueue *equeue;
(*aNewQueue)->GetPLEventQueue(&equeue);
PR_LOG(gEventQueueLog, PR_LOG_DEBUG,
("EventQueue: Service push queue [queue=%lx]",(long)equeue));
++gEventQueueLogCount;
#endif
}
}
// Release the EventQ lock...