From b1e2744599f30db4a6376e9c0cf1cdae7e1f438d Mon Sep 17 00:00:00 2001 From: davide Date: Mon, 12 Sep 2016 22:34:28 +0200 Subject: [PATCH] bug fixed --- include/spdlog/details/thread_pool.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/spdlog/details/thread_pool.h b/include/spdlog/details/thread_pool.h index 40fb4cc0..66e02c68 100644 --- a/include/spdlog/details/thread_pool.h +++ b/include/spdlog/details/thread_pool.h @@ -90,7 +90,8 @@ inline thread_pool::thread_pool(size_t num_threads, // if the weak pointer points to a delated handle, remove it if(!handle ){ _loop_handles.erase(handle_it); - _index = (_index) % _loop_handles.size(); + if( _loop_handles.empty() ==false) + _index = (_index) % _loop_handles.size(); } else{ // mark as busy