【问题描述】
该问题是由于 TStaticThread.Execute 等待事件超时时,未检查 Workers 对象是否处于清理状态造成的:
... wrTimeout: begin if (not Workers.Terminating) and Assigned(Workers.FSimpleJobs) and (Workers.FSimpleJobs.Count > 0) and (LastCpuUsage < 60) and (Workers.IdleWorkers = 0) then Workers.LookupIdleWorker(True); ... 改为 wrTimeout: begin if Assigned(Workers) and (not Workers.Terminating) and Assigned(Workers.FSimpleJobs) and (Workers.FSimpleJobs.Count > 0) and (LastCpuUsage < 60) and (Workers.IdleWorkers = 0) then Workers.LookupIdleWorker(True); ...
另外,新增 TQWorkers.OnError 属性,以处理作业异常信息。
【严重程度】
高
【更新级别】
推荐
【特别感谢】
浴火重生,青春