From bdca50e6a78d8c15d744da483d969216a6e3564b Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 23 Feb 2018 13:26:53 +0200 Subject: [PATCH] Fixed issue #637 --- include/spdlog/details/async_log_helper.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/spdlog/details/async_log_helper.h b/include/spdlog/details/async_log_helper.h index bba9bc0e..4ff51391 100644 --- a/include/spdlog/details/async_log_helper.h +++ b/include/spdlog/details/async_log_helper.h @@ -216,9 +216,10 @@ inline spdlog::details::async_log_helper::async_log_helper( _overflow_policy(overflow_policy), _worker_warmup_cb(worker_warmup_cb), _flush_interval_ms(flush_interval_ms), - _worker_teardown_cb(worker_teardown_cb), - _worker_thread(&async_log_helper::worker_loop, this) -{} + _worker_teardown_cb(worker_teardown_cb) +{ + _worker_thread = std::thread(&async_log_helper::worker_loop, this); +} // Send to the worker thread termination message(level=off) // and wait for it to finish gracefully