Skip to content

Commit

Permalink
Only check REDIS_FREEING when a callback was executed
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern committed Dec 28, 2010
1 parent e3776bf commit c882a36
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions async.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit c882a36

Please sign in to comment.