From 8f65c52f6cf161f6413f67984a56855d9a70086a Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 31 May 2011 20:01:55 +0000 Subject: [PATCH] clear queued callbacks once they have been requeued and fix typo --- chrome/content/zotero/xpcom/zotero.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index d528b0a49..254c905cb 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -1376,6 +1376,7 @@ var Zotero = new function(){ createInstance(Components.interfaces.nsITimer); timer.initWithCallback(timerCallback, 0, Components.interfaces.nsITimer.TYPE_ONE_SHOT); } + _waitTimerCallbacks = []; //Zotero.debug("Waited " + cycles + " cycles"); return; @@ -1394,7 +1395,7 @@ var Zotero = new function(){ var timerCallback = {"notify":function() { if(_waiting) { // if our callback gets called during Zotero.wait(), queue it to be set again - // when Zotero.wait() complets + // when Zotero.wait() completes _waitTimerCallbacks.push(timerCallback); } else { // otherwise, execute callback function