Index: scheduler/job.c =================================================================== --- scheduler/job.c (revision 8781) +++ scheduler/job.c (working copy) @@ -2297,18 +2297,33 @@ case IPP_JOB_ABORTED : case IPP_JOB_CANCELED : case IPP_JOB_COMPLETED : + if (newstate == IPP_JOB_CANCELED) + { + /* + * Remove the job from the active list if there are no processes still + * running for it... + */ + + for (i = 0; job->filters[i] < 0; i++); + + if (!job->filters[i] && job->backend <= 0) + cupsArrayRemove(ActiveJobs, job); + } + else + { + /* + * Otherwise just remove the job from the active list immediately... + */ + + cupsArrayRemove(ActiveJobs, job); + } + /* * Expire job subscriptions since the job is now "completed"... */ cupsdExpireSubscriptions(NULL, job); - /* - * Remove the job from the active list... - */ - - cupsArrayRemove(ActiveJobs, job); - #ifdef __APPLE__ /* * If we are going to sleep and the PrintingJobs count is now 0, allow the Index: scheduler/main.c =================================================================== --- scheduler/main.c (revision 8781) +++ scheduler/main.c (working copy) @@ -1793,6 +1793,18 @@ cupsdContinueJob(job); } } + else if (job->state_value == IPP_JOB_CANCELED) + { + /* + * Remove the job from the active list if there are no processes still + * running for it... + */ + + for (i = 0; job->filters[i] < 0; i++); + + if (!job->filters[i] && job->backend <= 0) + cupsArrayRemove(ActiveJobs, job); + } } }