From c882a3621a7354316b6bd9595edf096ff850a1a9 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Tue, 28 Dec 2010 19:35:26 +0100 Subject: Only check REDIS_FREEING when a callback was executed --- async.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'async.c') diff --git a/async.c b/async.c index 6d8c18e..8068056 100644 --- a/async.c +++ b/async.c @@ -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 */ -- cgit v1.2.3