Still invoke onDisconnect and dataCleanup even when NO_AUTOFREE is set.

See #712
This commit is contained in:
michael-grunder 2022-09-07 19:50:55 -07:00
parent d756f68a59
commit de73d24131

View File

@ -444,6 +444,13 @@ void __redisAsyncDisconnect(redisAsyncContext *ac) {
* callbacks with a NULL-reply. */
if (!(c->flags & REDIS_NO_AUTO_FREE)) {
__redisAsyncFree(ac);
} else {
if (c->flags & REDIS_CONNECTED) {
__redisRunDisconnectCallback(ac, ac->err == 0 ? REDIS_OK : REDIS_ERR);
}
if (ac->dataCleanup) {
ac->dataCleanup(ac->data);
}
}
}