[td-1391] refactor
This commit is contained in:
parent
5ff1dbe5f3
commit
9d1619c3b9
|
@ -286,9 +286,11 @@ void taos_close(TAOS *taos) {
|
||||||
assert(ref >= 0);
|
assert(ref >= 0);
|
||||||
|
|
||||||
if (ref > 0) {
|
if (ref > 0) {
|
||||||
|
tscDebug("%p %d remain sqlObjs, do not close dnodeConn:%p", pObj, ref, pObj->pDnodeConn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tscDebug("%p all sqlObj are freed, free tscObj, dnodeConn:%p", pObj, pObj->pDnodeConn);
|
||||||
tscCloseTscObj(pObj);
|
tscCloseTscObj(pObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -772,6 +772,7 @@ void tscCloseTscObj(STscObj* pObj) {
|
||||||
pObj->signature = NULL;
|
pObj->signature = NULL;
|
||||||
taosTmrStopA(&(pObj->pTimer));
|
taosTmrStopA(&(pObj->pTimer));
|
||||||
|
|
||||||
|
void* p = pObj->pDnodeConn;
|
||||||
if (pObj->pDnodeConn != NULL) {
|
if (pObj->pDnodeConn != NULL) {
|
||||||
rpcClose(pObj->pDnodeConn);
|
rpcClose(pObj->pDnodeConn);
|
||||||
pObj->pDnodeConn = NULL;
|
pObj->pDnodeConn = NULL;
|
||||||
|
@ -779,7 +780,7 @@ void tscCloseTscObj(STscObj* pObj) {
|
||||||
|
|
||||||
pthread_mutex_destroy(&pObj->mutex);
|
pthread_mutex_destroy(&pObj->mutex);
|
||||||
|
|
||||||
tscDebug("%p DB connection is closed, dnodeConn:%p", pObj, pObj->pDnodeConn);
|
tscDebug("%p DB connection is closed, dnodeConn:%p", pObj, p);
|
||||||
taosTFree(pObj);
|
taosTFree(pObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue