diff --git a/chrome/content/zotero/EPUB.jsm b/chrome/content/zotero/EPUB.jsm index b0b4e731a7..22f154e23a 100644 --- a/chrome/content/zotero/EPUB.jsm +++ b/chrome/content/zotero/EPUB.jsm @@ -56,6 +56,8 @@ class EPUB { close() { this._zipReader.close(); + this._zipReader = null + Cu.forceGC(); } async* getSectionDocuments() { diff --git a/chrome/content/zotero/xpcom/dictionaries.js b/chrome/content/zotero/xpcom/dictionaries.js index 74df1b3a89..4cdabf0cb0 100644 --- a/chrome/content/zotero/xpcom/dictionaries.js +++ b/chrome/content/zotero/xpcom/dictionaries.js @@ -136,6 +136,8 @@ Zotero.Dictionaries = new function () { } zipReader.close(); + zipReader = null + Cu.forceGC(); await OS.File.remove(xpiPath); await _loadDirectory(dir); } diff --git a/chrome/content/zotero/xpcom/storage/storageLocal.js b/chrome/content/zotero/xpcom/storage/storageLocal.js index 2aef651d84..7787deadc4 100644 --- a/chrome/content/zotero/xpcom/storage/storageLocal.js +++ b/chrome/content/zotero/xpcom/storage/storageLocal.js @@ -794,6 +794,8 @@ Zotero.Sync.Storage.Local = { catch (e) { Zotero.debug(zipFile.leafName + " is not a valid ZIP file", 2); zipReader.close(); + zipReader = null + Cu.forceGC(); try { zipFile.remove(false); @@ -813,6 +815,8 @@ Zotero.Sync.Storage.Local = { } catch (e) { zipReader.close(); + zipReader = null + Cu.forceGC(); throw e; } @@ -900,6 +904,8 @@ Zotero.Sync.Storage.Local = { Zotero.logError(e); zipReader.close(); + zipReader = null + Cu.forceGC(); Zotero.File.checkFileAccessError(e, destPath, 'create'); } @@ -914,6 +920,9 @@ Zotero.Sync.Storage.Local = { } catch (e) {} zipReader.close(); + zipReader = null + Cu.forceGC(); + // TODO: localize var msg = "Due to a Windows path length limitation, your Zotero data directory " + "is too deep in the filesystem for syncing to work reliably. " @@ -950,6 +959,8 @@ Zotero.Sync.Storage.Local = { } zipReader.close(); + zipReader = null + Cu.forceGC(); Zotero.File.checkFileAccessError(e, destPath, 'create'); } @@ -962,6 +973,9 @@ Zotero.Sync.Storage.Local = { } } zipReader.close(); + zipReader = null + Cu.forceGC(); + zipFile.remove(false); return returnFile;