Fixed race condition when using --no-color

This commit is contained in:
SChernykh 2021-10-28 10:36:50 +02:00
parent 2071a24a9f
commit 88f346414a

View file

@ -160,7 +160,10 @@ private:
p += 3;
size -= 3;
if (!CONSOLE_COLORS) {
// Read CONSOLE_COLORS only once because its value can be changed in another thread
const bool c = CONSOLE_COLORS;
if (!c) {
strip_colors(p, size);
}
@ -181,7 +184,7 @@ private:
}
if (m_logFile.is_open()) {
if (CONSOLE_COLORS) {
if (c) {
strip_colors(p, size);
}