From 66e306d9234f91e26f3760adda8def9660704b0f Mon Sep 17 00:00:00 2001 From: Bryan Dallas Date: Tue, 1 Sep 2015 11:41:51 -0400 Subject: [PATCH] Fix for variable in the wrong scope. --- src/client.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index 63c87da..5128327 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -148,9 +148,10 @@ void Redox::connectedCallback(const redisAsyncContext *ctx, int status) { } rdx->connect_waiter_.notify_all(); + int state; { unique_lock lk(rdx->connect_lock_); - int state = rdx->connect_state_; + state = rdx->connect_state_; } if (rdx->user_connection_callback_) rdx->user_connection_callback_(state); @@ -172,9 +173,10 @@ void Redox::disconnectedCallback(const redisAsyncContext *ctx, int status) { rdx->stop(); rdx->connect_waiter_.notify_all(); + int state; { unique_lock lk(rdx->connect_lock_); - int state = rdx->connect_state_; + state = rdx->connect_state_; } if (rdx->user_connection_callback_) rdx->user_connection_callback_(state); -- libgit2 0.21.4