Commit 66e306d9234f91e26f3760adda8def9660704b0f

Authored by Bryan Dallas
1 parent 1d77edb0

Fix for variable in the wrong scope.

Showing 1 changed file with 4 additions and 2 deletions
src/client.cpp
... ... @@ -148,9 +148,10 @@ void Redox::connectedCallback(const redisAsyncContext *ctx, int status) {
148 148 }
149 149  
150 150 rdx->connect_waiter_.notify_all();
  151 + int state;
151 152 {
152 153 unique_lock<mutex> lk(rdx->connect_lock_);
153   - int state = rdx->connect_state_;
  154 + state = rdx->connect_state_;
154 155 }
155 156 if (rdx->user_connection_callback_)
156 157 rdx->user_connection_callback_(state);
... ... @@ -172,9 +173,10 @@ void Redox::disconnectedCallback(const redisAsyncContext *ctx, int status) {
172 173  
173 174 rdx->stop();
174 175 rdx->connect_waiter_.notify_all();
  176 + int state;
175 177 {
176 178 unique_lock<mutex> lk(rdx->connect_lock_);
177   - int state = rdx->connect_state_;
  179 + state = rdx->connect_state_;
178 180 }
179 181 if (rdx->user_connection_callback_)
180 182 rdx->user_connection_callback_(state);
... ...