mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-03-30 12:10:12 +03:00
Call abort on all jobs before the queue gets cleared
This commit is contained in:
parent
16805b89fd
commit
55ea2c3b51
1 changed files with 9 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue