From 54b868122d3b7db62b7d342b24f71a95d4878dfa Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Mon, 24 Nov 2014 15:08:53 +0200 Subject: [PATCH] Update async_sink.h --- include/spdlog/sinks/async_sink.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/spdlog/sinks/async_sink.h b/include/spdlog/sinks/async_sink.h index 44392685..fe87c10b 100644 --- a/include/spdlog/sinks/async_sink.h +++ b/include/spdlog/sinks/async_sink.h @@ -181,8 +181,12 @@ inline void spdlog::sinks::async_sink::shutdown(const log_clock::duration& timeo inline void spdlog::sinks::async_sink::_push_sentry() { - if (_last_backthread_ex) - throw *std::move(_last_backthread_ex); + if (_last_backthread_ex) + { + auto ex = std::move(_last_backthread_ex); + _last_backthread_ex.reset(); + throw *ex; + } if (!_active) throw(spdlog_ex("async_sink not active")); }