[*] Fix no flush after blocking write on logger dtor

This commit is contained in:
Reece Wilson 2022-02-21 20:35:16 +00:00
parent ef04d2bac3
commit 01254d088b

View File

@ -216,10 +216,8 @@ namespace Aurora::Logging
}
}
void ForceFlushFlush()
void ForceFlushFlushNoLock()
{
AU_LOCK_GUARD(gGlobalSpin);
for (const auto &logger : gFlushableLoggers)
{
for (const auto &sink : logger->sinks)
@ -241,12 +239,19 @@ namespace Aurora::Logging
}
}
void ForceFlushFlush()
{
AU_LOCK_GUARD(gGlobalSpin);
ForceFlushFlushNoLock();
}
void Logger::Disable()
{
AU_LOCK_GUARD(gGlobalSpin);
ForceFlushLoggersNoLock();
ForceFlushFlushNoLock();
{
AU_LOCK_GUARD(spin);