Fixed imageLoaderLimit

Currently jobsInProgress was not incremented after adding a job. So it
has gone into the - range and was like unlimited jobs.
This commit is contained in:
Philip Giuliani 2014-12-19 15:50:19 +01:00
parent c737bad66e
commit b82f5cea76

View File

@ -133,7 +133,7 @@ $.ImageLoader.prototype = /** @lends OpenSeadragon.ImageLoader.prototype */{
this.jobsInProgress++; this.jobsInProgress++;
} }
else { else {
this.jobQueue.push( newJob ); this.jobQueue.push( newJob );
} }
}, },
@ -162,6 +162,7 @@ function completeJob( loader, job, callback ) {
if ( (!loader.jobLimit || loader.jobsInProgress < loader.jobLimit) && loader.jobQueue.length > 0) { if ( (!loader.jobLimit || loader.jobsInProgress < loader.jobLimit) && loader.jobQueue.length > 0) {
nextJob = loader.jobQueue.shift(); nextJob = loader.jobQueue.shift();
nextJob.start(); nextJob.start();
loader.jobsInProgress++;
} }
callback( job.image ); callback( job.image );