From 48ce4a94b37d618fe81f8495d4ff101ba256aae7 Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 1 Nov 2024 10:41:27 +0200 Subject: [PATCH] Revert "Ensure flush callback gets called in move-assign operator (#3232)" This reverts commit b6da59447f165ad70a4e3ca1c575b14ea66d92c9. --- include/spdlog/details/thread_pool.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/spdlog/details/thread_pool.h b/include/spdlog/details/thread_pool.h index 84661371..4d7e1d75 100644 --- a/include/spdlog/details/thread_pool.h +++ b/include/spdlog/details/thread_pool.h @@ -49,12 +49,12 @@ struct async_msg : log_msg_buffer { flush_callback(std::move(other.flush_callback)) { other.flush_callback = nullptr; } - async_msg &operator=(async_msg &&other) SPDLOG_NOEXCEPT { *static_cast(this) = static_cast(other); msg_type = other.msg_type; worker_ptr = std::move(other.worker_ptr); - std::swap(flush_callback, other.flush_callback); + flush_callback = std::move(other.flush_callback); + other.flush_callback = nullptr; return *this; }