Don't leak memory when showing the select dialog

Again, I'm pretty sure this shouldn't be necessary.
This commit is contained in:
Simon Kornblith 2015-07-26 14:06:10 -04:00
parent 51bcd2409d
commit 954e60a83a

View file

@ -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