From 87398c29fa7a3b8453c3fce7d80c208d0c2438d7 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 5 Sep 2008 02:42:54 +0000 Subject: [PATCH] Fix ACCESS_DENIED storage sync error on Windows --- chrome/content/zotero/xpcom/storage.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index cbb7abf3b..b89c28cc7 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -1201,7 +1201,8 @@ Zotero.Sync.Storage = new function () { { onProgress: _updateProgress, onStop: _onUploadComplete, - item: item + item: item, + streams: [fis, bis] } ); channel.notificationCallbacks = listener; @@ -2019,9 +2020,10 @@ Zotero.Sync.Storage.ZipWriterObserver.prototype = { /** * Possible properties of data object: - * - onStart f(request) - * - onProgress f(name, progess, progressMax) - * - onStop f(request, status, response, data) + * - onStart: f(request) + * - onProgress: f(name, progess, progressMax) + * - onStop: f(request, status, response, data) + * - streams: array of streams to close on completion * - Other values to pass to onStop() */ Zotero.Sync.Storage.StreamListener = function (data) { @@ -2137,6 +2139,12 @@ Zotero.Sync.Storage.StreamListener.prototype = { request.QueryInterface(Components.interfaces.nsIRequest); } + if (this._data.streams) { + for each(var stream in this._data.streams) { + stream.close(); + } + } + if (this._data.onStop) { // Remove callbacks before passing along var passData = {};