Added lock to qt_color_sink

This commit is contained in:
Gabi Melman 2023-06-08 01:12:25 +03:00 committed by GitHub
parent 32bab0e103
commit 3a7188505f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,13 +118,13 @@ public:
void set_default_color(QTextCharFormat format) void set_default_color(QTextCharFormat format)
{ {
// std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_); std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_);
default_color_ = format; default_color_ = format;
} }
void set_level_color(level::level_enum color_level, QTextCharFormat format) void set_level_color(level::level_enum color_level, QTextCharFormat format)
{ {
// std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_); std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_);
colors_.at(static_cast<size_t>(color_level)) = format; colors_.at(static_cast<size_t>(color_level)) = format;
} }