Only check REDIS_FREEING when a callback was executed
This commit is contained in:
parent
e3776bfaa6
commit
c882a3621a
6
async.c
6
async.c
@ -246,15 +246,15 @@ void redisProcessCallbacks(redisAsyncContext *ac) {
|
|||||||
assert(__redisShiftCallback(&ac->replies,&cb) == REDIS_OK);
|
assert(__redisShiftCallback(&ac->replies,&cb) == REDIS_OK);
|
||||||
if (cb.fn != NULL) {
|
if (cb.fn != NULL) {
|
||||||
cb.fn(ac,reply,cb.privdata);
|
cb.fn(ac,reply,cb.privdata);
|
||||||
} else {
|
|
||||||
c->fn->freeObject(reply);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Proceed with free'ing when redisAsyncFree() was called. */
|
/* Proceed with free'ing when redisAsyncFree() was called. */
|
||||||
if (c->flags & REDIS_FREEING) {
|
if (c->flags & REDIS_FREEING) {
|
||||||
__redisAsyncFree(ac);
|
__redisAsyncFree(ac);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
c->fn->freeObject(reply);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Disconnect when there was an error reading the reply */
|
/* Disconnect when there was an error reading the reply */
|
||||||
|
Loading…
Reference in New Issue
Block a user