diff --git a/src/methods.cc b/src/methods.cc index 9e1fe1c..821928f 100644 --- a/src/methods.cc +++ b/src/methods.cc @@ -257,9 +257,8 @@ void ImageManipulator::threaded_get_color(int const t_h) reference_.at(t_h, w + 2)}; auto pos = std::find(std::begin(colors_), std::end(colors_), temp); if (pos == std::end(colors_)) { - colors_mutex_.lock(); + std::lock_guard lock(colors_mutex_); colors_.push_back(std::move(temp)); - colors_mutex_.unlock(); } } }