/// <summary>
 /// Performs cleanup after cmdlet execution.
 /// </summary>
 public override void EndProcessing()
 {
     _parentJob.EndOfChildJobs();
     if (this.AsJob.IsPresent)
     {
         this.Cmdlet.WriteObject(_parentJob);
         this.Cmdlet.JobRepository.Add(_parentJob);
         _parentJob = null; // this class doesn't own parentJob after it has been emitted to the outside world
     }
     else
     {
         _parentJob.ForwardAllResultsToCmdlet(this.Cmdlet);
         _parentJob.Finished.WaitOne();
     }
 }