Shut up all channels on exit at some point

Some object are getting destroyed.
Makes valgrind more quiet.
This commit is contained in:
Nekotekina 2020-02-29 17:19:53 +03:00
parent 5871c4e93f
commit d37e770497

View File

@ -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)