diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 148cca8dbc..f2111eb2a2 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -2608,8 +2608,13 @@ void taosAsyncFetchImpl(SRequestObj* pRequest, __taos_async_fn_t fp, void* param void doRequestCallback(SRequestObj* pRequest, int32_t code) { pRequest->inCallback = true; + int64_t this = pRequest->self; pRequest->body.queryFp(((SSyncQueryParam *)pRequest->body.interParam)->userParam, pRequest, code); - pRequest->inCallback = false; + SRequestObj* pReq = acquireRequest(this); + if (pReq != NULL) { + pReq->inCallback = false; + releaseRequest(this); + } } int32_t clientParseSql(void* param, const char* dbName, const char* sql, bool parseOnly, const char* effectiveUser, SParseSqlRes* pRes) {