diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-12-28 19:35:26 +0100 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-12-28 19:35:26 +0100 |
commit | c882a3621a7354316b6bd9595edf096ff850a1a9 (patch) | |
tree | 5b7a28f97ab7bea68ef5ea2ea94e3f97ffcbf09d | |
parent | e3776bfaa65bf40a7c43917c6985f0d83c1afd76 (diff) |
Only check REDIS_FREEING when a callback was executed
-rw-r--r-- | async.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -246,15 +246,15 @@ void redisProcessCallbacks(redisAsyncContext *ac) { assert(__redisShiftCallback(&ac->replies,&cb) == REDIS_OK); if (cb.fn != NULL) { cb.fn(ac,reply,cb.privdata); + + /* Proceed with free'ing when redisAsyncFree() was called. */ + if (c->flags & REDIS_FREEING) { + __redisAsyncFree(ac); + return; + } } else { c->fn->freeObject(reply); } - - /* Proceed with free'ing when redisAsyncFree() was called. */ - if (c->flags & REDIS_FREEING) { - __redisAsyncFree(ac); - return; - } } /* Disconnect when there was an error reading the reply */ |