From fdd12f6d753e0c8d0aca163faa15e6447f4546fb Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Fri, 7 Jun 2019 14:28:56 +0200 Subject: [PATCH] RAII --- src/methods.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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(); } } }