The current round of Coverity static analysis identified a couple of minor issues in PTL, which this PR attempts to address:
ThreadPool owns some resources via raw pointers, which should be deleted in its destructor in case the destroy_threadpool member function was not called beforehand. This is safe as deleting a null pointer is fine.
No need to check non-null on ThreadPool's shared_ptr resources as these always hold something.
TaskManagers destructor needs to be marked noexcept(false) as it may throw due to the call to ThreadPool::destroy_threadpool.
If the potential exception can be handled in TaskManager::finalize, that would be the better solution, but it's not clear to me that this can done.
The current round of Coverity static analysis identified a couple of minor issues in PTL, which this PR attempts to address:
ThreadPool
owns some resources via raw pointers, which should bedelete
d in its destructor in case thedestroy_threadpool
member function was not called beforehand. This is safe as deleting a null pointer is fine.shared_ptr
resources as these always hold something.TaskManager
s destructor needs to be markednoexcept(false)
as it may throw due to the call toThreadPool::destroy_threadpool
.TaskManager::finalize
, that would be the better solution, but it's not clear to me that this can done.