fix mem leak
This commit is contained in:
parent
80ea523c8b
commit
e6ca3844e1
|
@ -658,7 +658,6 @@ static void cliDestroyConn(SCliConn* conn, bool clear) {
|
||||||
QUEUE_REMOVE(&conn->q);
|
QUEUE_REMOVE(&conn->q);
|
||||||
QUEUE_INIT(&conn->q);
|
QUEUE_INIT(&conn->q);
|
||||||
transRemoveExHandle(transGetRefMgt(), conn->refId);
|
transRemoveExHandle(transGetRefMgt(), conn->refId);
|
||||||
transDestroyBuffer(&conn->readBuf);
|
|
||||||
|
|
||||||
conn->refId = -1;
|
conn->refId = -1;
|
||||||
if (conn->task != NULL) transDQCancel(((SCliThrd*)conn->hostThrd)->timeoutQueue, conn->task);
|
if (conn->task != NULL) transDQCancel(((SCliThrd*)conn->hostThrd)->timeoutQueue, conn->task);
|
||||||
|
@ -685,7 +684,7 @@ static void cliDestroy(uv_handle_t* handle) {
|
||||||
transQueueDestroy(&conn->cliMsgs);
|
transQueueDestroy(&conn->cliMsgs);
|
||||||
tTrace("%s conn %p destroy successfully", CONN_GET_INST_LABEL(conn), conn);
|
tTrace("%s conn %p destroy successfully", CONN_GET_INST_LABEL(conn), conn);
|
||||||
transReqQueueClear(&conn->wreqQueue);
|
transReqQueueClear(&conn->wreqQueue);
|
||||||
|
transDestroyBuffer(&conn->readBuf);
|
||||||
taosMemoryFree(conn);
|
taosMemoryFree(conn);
|
||||||
}
|
}
|
||||||
static bool cliHandleNoResp(SCliConn* conn) {
|
static bool cliHandleNoResp(SCliConn* conn) {
|
||||||
|
|
|
@ -830,7 +830,6 @@ static void destroyConn(SSvrConn* conn, bool clear) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
transDestroyBuffer(&conn->readBuf);
|
|
||||||
if (clear) {
|
if (clear) {
|
||||||
if (!uv_is_closing((uv_handle_t*)conn->pTcp)) {
|
if (!uv_is_closing((uv_handle_t*)conn->pTcp)) {
|
||||||
tTrace("conn %p to be destroyed", conn);
|
tTrace("conn %p to be destroyed", conn);
|
||||||
|
@ -881,6 +880,7 @@ static void uvDestroyConn(uv_handle_t* handle) {
|
||||||
QUEUE_REMOVE(&conn->queue);
|
QUEUE_REMOVE(&conn->queue);
|
||||||
taosMemoryFree(conn->pTcp);
|
taosMemoryFree(conn->pTcp);
|
||||||
destroyConnRegArg(conn);
|
destroyConnRegArg(conn);
|
||||||
|
transDestroyBuffer(&conn->readBuf);
|
||||||
taosMemoryFree(conn);
|
taosMemoryFree(conn);
|
||||||
|
|
||||||
if (thrd->quit && QUEUE_IS_EMPTY(&thrd->conn)) {
|
if (thrd->quit && QUEUE_IS_EMPTY(&thrd->conn)) {
|
||||||
|
|
Loading…
Reference in New Issue