From 94d2556db665fe42cd90d68ae1850f89ce837298 Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Mon, 24 Nov 2014 15:02:43 +0200 Subject: [PATCH] Update last exception moving from worker thread to user thread in async mode --- include/spdlog/sinks/async_sink.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/spdlog/sinks/async_sink.h b/include/spdlog/sinks/async_sink.h index 54ff89b3..44392685 100644 --- a/include/spdlog/sinks/async_sink.h +++ b/include/spdlog/sinks/async_sink.h @@ -181,9 +181,8 @@ inline void spdlog::sinks::async_sink::shutdown(const log_clock::duration& timeo inline void spdlog::sinks::async_sink::_push_sentry() { - std::shared_ptr ex_copy = std::move(_last_backthread_ex); - if (ex_copy) - throw *ex_copy; + if (_last_backthread_ex) + throw *std::move(_last_backthread_ex); if (!_active) throw(spdlog_ex("async_sink not active")); }