Bug 328810 shutting down calendar doesn't wait for in-progress writes to finish, r=mvl

This commit is contained in:
jminta%gmail.com 2006-08-23 17:09:53 +00:00
Родитель 6921ce2db4
Коммит 4d5594ff34
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -327,6 +327,8 @@ calICSCalendar.prototype = {
doWriteICS: function () {
var savedthis = this;
var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"]
.getService(Components.interfaces.nsIAppStartup);
var listener =
{
onOperationComplete: function(aCalendar, aStatus, aOperationType, aId, aDetail)
@ -354,9 +356,10 @@ calICSCalendar.prototype = {
uploadChannel.setUploadStream(icsStream, "text/calendar",
-1);
appStartup.enterLastWindowClosingSurvivalArea();
channel.asyncOpen(savedthis, savedthis);
} catch (ex) {
appStartup.exitLastWindowClosingSurvivalArea();
savedthis.mObserver.onError(
ex.result, "The calendar could not be saved; there " +
"was a failure: 0x" + ex.result.toString(16));
@ -431,6 +434,9 @@ calICSCalendar.prototype = {
ctxt.mHooks.onAfterPut(channel);
ctxt.unlock();
var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"]
.getService(Components.interfaces.nsIAppStartup);
appStartup.exitLastWindowClosingSurvivalArea();
},
addObserver: function (aObserver) {