提交 7aa282c5 编写于 作者: S stephenkgu

[TD-2337]/<fix>: fix *Ref is not there* when unable to establish connection

上级 e9632baf
...@@ -292,16 +292,18 @@ void taos_close(TAOS *taos) { ...@@ -292,16 +292,18 @@ void taos_close(TAOS *taos) {
pObj->signature = NULL; pObj->signature = NULL;
taosTmrStopA(&(pObj->pTimer)); taosTmrStopA(&(pObj->pTimer));
SSqlObj* pHb = (SSqlObj*)taosAcquireRef(tscObjRef, pObj->hbrid); if (pObj->hbrid > 0) {
if (pHb != NULL) { SSqlObj* pHb = (SSqlObj*)taosAcquireRef(tscObjRef, pObj->hbrid);
if (pHb->rpcRid > 0) { // wait for rsp from dnode if (pHb != NULL) {
rpcCancelRequest(pHb->rpcRid); if (pHb->rpcRid > 0) { // wait for rsp from dnode
pHb->rpcRid = -1; rpcCancelRequest(pHb->rpcRid);
} pHb->rpcRid = -1;
}
tscDebug("%p HB is freed", pHb); tscDebug("%p HB is freed", pHb);
taos_free_result(pHb); taos_free_result(pHb);
taosReleaseRef(tscObjRef, pHb->self); taosReleaseRef(tscObjRef, pHb->self);
}
} }
int32_t ref = T_REF_DEC(pObj); int32_t ref = T_REF_DEC(pObj);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册