mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-16 23:03:13 +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 = {
|
jobOptions = {
|
||||||
src: options.src,
|
src: options.src,
|
||||||
crossOriginPolicy: options.crossOriginPolicy,
|
crossOriginPolicy: options.crossOriginPolicy,
|
||||||
callback: complete
|
callback: complete,
|
||||||
|
abort: options.abort
|
||||||
},
|
},
|
||||||
newJob = new ImageJob( jobOptions );
|
newJob = new ImageJob( jobOptions );
|
||||||
|
|
||||||
@ -142,6 +143,13 @@ $.ImageLoader.prototype = /** @lends OpenSeadragon.ImageLoader.prototype */{
|
|||||||
* @method
|
* @method
|
||||||
*/
|
*/
|
||||||
clear: function() {
|
clear: function() {
|
||||||
|
for( var i = 0; i < this.jobQueue.length; i++ ) {
|
||||||
|
job = this.jobQueue[i];
|
||||||
|
if ( typeof job.abort === "function" ) {
|
||||||
|
job.abort();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.jobQueue = [];
|
this.jobQueue = [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user