From 621e43a39c9ab731a0d9c2a142c46d46c7c3cf24 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 16 Mar 2011 23:02:26 +0000 Subject: [PATCH] fix potential recurrence of garbage collection nightmare --- chrome/content/zotero/xpcom/translation/browser_firefox.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/browser_firefox.js b/chrome/content/zotero/xpcom/translation/browser_firefox.js index dd2986d0a..c9cca5e41 100644 --- a/chrome/content/zotero/xpcom/translation/browser_firefox.js +++ b/chrome/content/zotero/xpcom/translation/browser_firefox.js @@ -139,7 +139,6 @@ Zotero.Translate.IO.maintainedInstances = []; /******* (Native) Read support *******/ Zotero.Translate.IO.Read = function(file, mode) { - Zotero.Translate.IO.maintainedInstances.push(this); this.file = file; // open file @@ -388,6 +387,9 @@ Zotero.Translate.IO.Read.prototype = { }, "reset":function(newMode) { + if(Zotero.Translate.IO.maintainedInstances.indexOf(this) === -1) { + Zotero.Translate.IO.maintainedInstances.push(this); + } this._seekToStart(this._charset); this._mode = newMode;