diff --git a/apf/mimoprocessor.h b/apf/mimoprocessor.h index 9112f51..c2a0f99 100644 --- a/apf/mimoprocessor.h +++ b/apf/mimoprocessor.h @@ -369,10 +369,15 @@ class MimoProcessor : public interface_policy , _parent(parent) , _thread(std::thread(&WorkerThread::_thread_function, this)) { - // Set thread priority from interface_policy, if available - thread_traits::set_priority(parent - , _thread.native_handle()); + try { + // Set thread priority from interface_policy, if available + thread_traits::set_priority(parent + , _thread.native_handle()); + } catch(...) { + this->~WorkerThread(); + throw; + } } WorkerThread(WorkerThread&& other)