Bug 1068962 - Fix task cleanup on settings locks where finalize has already been called; r=bent

--HG--
extra : rebase_source : 18992e6c2e0277d2866fe92048b52a0a55a55ee6
This commit is contained in:
Kyle Machulis 2014-09-18 13:43:40 -07:00
parent f52164c1b5
commit e752fcb527

View File

@ -580,9 +580,11 @@ let SettingsRequestManager = {
while (currentTask) {
if (DEBUG) debug("Running Operation " + currentTask.operation);
if (lock.finalizing) {
// We should really never get to this point, but if we do,
// fail every task that happens.
Cu.reportError("Settings lock trying to run more tasks after finalizing. Ignoring tasks, but this is bad. Lock: " + aLockID);
continue;
}
currentTask.defer.reject("Cannot call new task after finalizing");
} else {
let p;
switch (currentTask.operation) {
case "get":
@ -607,6 +609,7 @@ let SettingsRequestManager = {
ret.task.defer.reject(ret.error);
});
promises.push(p);
}
currentTask = lock.tasks.shift();
}
},