mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Call abort on all jobs before the queue gets cleared
This commit is contained in:
parent
16805b89fd
commit
55ea2c3b51
@ -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 = [];
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user