free unfinished ahandle while quit

This commit is contained in:
yihaoDeng 2022-11-11 19:41:02 +08:00
parent 3572fa7f67
commit 197d5d4b7a
1 changed files with 2 additions and 3 deletions

View File

@ -263,16 +263,15 @@ static void* cliWorkThread(void* arg);
static void cliReleaseUnfinishedMsg(SCliConn* conn) {
SCliThrd* pThrd = conn->hostThrd;
STrans* pTransInst = pThrd->pTransInst;
for (int i = 0; i < transQueueSize(&conn->cliMsgs); i++) {
SCliMsg* msg = transQueueGet(&conn->cliMsgs, i);
if (msg != NULL && msg->ctx != NULL && msg->ctx->ahandle != (void*)0x9527) {
if (conn->ctx.freeFunc != NULL && msg->ctx->ahandle != NULL) {
conn->ctx.freeFunc(msg->ctx->ahandle);
} else if (msg->ctx->ahandle != NULL && pTransInst->destroyFp != NULL) {
} else if (msg->ctx->ahandle != NULL && pThrd->destroyAhandleFp != NULL) {
tDebug("%s conn %p destroy unfinished ahandle %p", CONN_GET_INST_LABEL(conn), conn, msg->ctx->ahandle);
pTransInst->destroyFp(msg->ctx->ahandle);
pThrd->destroyAhandleFp(msg->ctx->ahandle);
}
}
destroyCmsg(msg);