Disconnect before free'ing
This commit is contained in:
parent
9cd3b03d84
commit
b60952f22a
@ -594,6 +594,11 @@ void redisDisconnect(redisContext *c) {
|
||||
}
|
||||
|
||||
void redisFree(redisContext *c) {
|
||||
/* Disconnect before free'ing if not yet disconnected. */
|
||||
if (c->flags & REDIS_CONNECTED)
|
||||
redisDisconnect(c);
|
||||
|
||||
/* Fire free callback and clear all allocations. */
|
||||
if (c->cbFree != NULL)
|
||||
c->cbFree(c,c->privdataFree);
|
||||
if (c->error != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user