www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 954e60a83a0d089dfcec838c3ae616e07d454c6c
parent 51bcd2409d80b1822d40f88ef4e08388d7a75768
Author: Simon Kornblith <simon@simonster.com>
Date:   Sun, 26 Jul 2015 14:06:10 -0400

Don't leak memory when showing the select dialog

Again, I'm pretty sure this shouldn't be necessary.

Diffstat:
Mchrome/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 @@ -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