From 8eda39ad7ea618538e5b5073210a2b9ce1025575 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 6 Oct 2011 01:40:35 +0000 Subject: [PATCH] Requeue nsITimerCallbacks that didn't execute during pumpGenerator --- chrome/content/zotero/xpcom/zotero.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 1822724ce..e9ae5a47e 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -1521,6 +1521,13 @@ const ZOTERO_CONFIG = { timer.cancel(); _runningTimers.splice(_runningTimers.indexOf(timer), 1); + // requeue nsITimerCallbacks that came up during generator pumping but couldn't execute + for(var i in _waitTimers) { + _waitTimers[i].initWithCallback(_waitTimerCallbacks[i], 0, Components.interfaces.nsITimer.TYPE_ONE_SHOT); + } + _waitTimers = []; + _waitTimerCallbacks = []; + if(err) throw err; }} timer.initWithCallback(timerCallback, ms ? ms : 0, Components.interfaces.nsITimer.TYPE_REPEATING_SLACK);