Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't allow a job with id 0 (will be used for invalid job id)

  • Loading branch information...
commit 1d985fcfa462134f7c2cf4a7a89a5a8e12da5b7c 1 parent c47e925
Jonathan Marshall authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 xbmc/utils/JobManager.cpp
View
7 xbmc/utils/JobManager.cpp
@@ -203,8 +203,13 @@ unsigned int CJobManager::AddJob(CJob *job, IJobCallback *callback, CJob::PRIORI
{
CSingleLock lock(m_section);
+ // increment the job counter, ensuring 0 (invalid job) is never hit
+ m_jobCounter++;
+ if (m_jobCounter == 0)
+ m_jobCounter++;
+
// create a work item for this job
- CWorkItem work(job, m_jobCounter++, callback);
+ CWorkItem work(job, m_jobCounter, callback);
m_jobQueue[priority].push_back(work);
StartWorkers(priority);
Please sign in to comment.
Something went wrong with that request. Please try again.