Call abort on all jobs before the queue gets cleared

This commit is contained in:
Philip Giuliani 2015-03-03 09:29:23 +01:00
parent 16805b89fd
commit 55ea2c3b51

View File

@ -124,7 +124,8 @@ $.ImageLoader.prototype = /** @lends OpenSeadragon.ImageLoader.prototype */{
jobOptions = {
src: options.src,
crossOriginPolicy: options.crossOriginPolicy,
callback: complete
callback: complete,
abort: options.abort
},
newJob = new ImageJob( jobOptions );
@ -142,6 +143,13 @@ $.ImageLoader.prototype = /** @lends OpenSeadragon.ImageLoader.prototype */{
* @method
*/
clear: function() {
for( var i = 0; i < this.jobQueue.length; i++ ) {
job = this.jobQueue[i];
if ( typeof job.abort === "function" ) {
job.abort();
}
}
this.jobQueue = [];
}
};