From 87ff584e91893e22a4e3232c7ee3a58c13a246e3 Mon Sep 17 00:00:00 2001 From: Bryan Dallas Date: Tue, 1 Sep 2015 10:53:59 -0400 Subject: [PATCH] Fixed usage of running_ that did not include a lock. --- include/redox/client.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/redox/client.hpp b/include/redox/client.hpp index 364dc35..43cfc63 100644 --- a/include/redox/client.hpp +++ b/include/redox/client.hpp @@ -393,9 +393,11 @@ template Command &Redox::createCommand(const std::vector &cmd, const std::function &)> &callback, double repeat, double after, bool free_memory) { - - if (!running_) { - throw std::runtime_error("[ERROR] Need to connect Redox before running commands!"); + { + unique_lock ul(running_lock_); + if (!running_) { + throw std::runtime_error("[ERROR] Need to connect Redox before running commands!"); + } } commands_created_ += 1; -- libgit2 0.21.4