From d37e770497468b3471718c0e0b505e1a4378698e Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 29 Feb 2020 17:19:53 +0300 Subject: [PATCH] Shut up all channels on exit at some point Some object are getting destroyed. Makes valgrind more quiet. --- Utilities/Log.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Utilities/Log.cpp b/Utilities/Log.cpp index 6a4092334c..d6950a4ba9 100644 --- a/Utilities/Log.cpp +++ b/Utilities/Log.cpp @@ -245,6 +245,19 @@ namespace logs logs::listener::~listener() { + // Shut up all channels on exit + if (auto logger = get_logger()) + { + if (logger == this) + { + return; + } + + for (auto&& pair : logger->channels) + { + pair.second->enabled.store(level::always, std::memory_order_relaxed); + } + } } void logs::listener::add(logs::listener* _new)