From 954e60a83a0d089dfcec838c3ae616e07d454c6c Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 26 Jul 2015 14:06:10 -0400 Subject: [PATCH] Don't leak memory when showing the select dialog Again, I'm pretty sure this shouldn't be necessary. --- chrome/content/zotero/xpcom/translation/translate.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 2928042ae..a0b43450e 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -450,7 +450,7 @@ Zotero.Translate.Sandbox = { */ "selectItems":function(translate, items, callback) { function transferObject(obj) { - return Zotero.isFx ? translate._sandboxManager.copyObject(obj) : obj; + return Zotero.isFx && !Zotero.isBookmarklet ? translate._sandboxManager.copyObject(obj) : obj; } if(Zotero.Utilities.isEmpty(items)) { @@ -499,6 +499,10 @@ Zotero.Translate.Sandbox = { }; } + if(Zotero.isFx && !Zotero.isBookmarklet) { + items = Components.utils.cloneInto(items, {}); + } + var returnValue = translate._runHandler("select", items, newCallback); if(returnValue !== undefined) { // handler may have returned a value, which makes callback unnecessary