refactor:fix memory leak
This commit is contained in:
parent
98a2d311b7
commit
a1afea4066
|
@ -1041,18 +1041,6 @@ static void destroyInsertParseContextForTable(SInsertParseContext* pCxt) {
|
||||||
destroyCreateSubTbReq(&pCxt->createTblReq);
|
destroyCreateSubTbReq(&pCxt->createTblReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void destroyDataBlock(STableDataBlocks* pDataBlock) {
|
|
||||||
if (pDataBlock == NULL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
taosMemoryFreeClear(pDataBlock->pData);
|
|
||||||
if (!pDataBlock->cloned) {
|
|
||||||
destroyBoundColumnInfo(&pDataBlock->boundColumnInfo);
|
|
||||||
}
|
|
||||||
taosMemoryFreeClear(pDataBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void destroyInsertParseContext(SInsertParseContext* pCxt) {
|
static void destroyInsertParseContext(SInsertParseContext* pCxt) {
|
||||||
destroyInsertParseContextForTable(pCxt);
|
destroyInsertParseContextForTable(pCxt);
|
||||||
taosHashCleanup(pCxt->pVgroupsHashObj);
|
taosHashCleanup(pCxt->pVgroupsHashObj);
|
||||||
|
@ -1301,6 +1289,7 @@ int32_t qBuildStmtOutput(SQuery* pQuery, SHashObj* pVgHash, SHashObj* pBlockHash
|
||||||
|
|
||||||
CHECK_CODE(buildOutput(&insertCtx));
|
CHECK_CODE(buildOutput(&insertCtx));
|
||||||
|
|
||||||
|
destroyInsertParseContext(&insertCtx);
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -237,9 +237,7 @@ static void destroyDataBlock(STableDataBlocks* pDataBlock) {
|
||||||
taosMemoryFreeClear(pDataBlock->pData);
|
taosMemoryFreeClear(pDataBlock->pData);
|
||||||
if (!pDataBlock->cloned) {
|
if (!pDataBlock->cloned) {
|
||||||
// free the refcount for metermeta
|
// free the refcount for metermeta
|
||||||
if (pDataBlock->pTableMeta != NULL) {
|
taosMemoryFreeClear(pDataBlock->pTableMeta);
|
||||||
taosMemoryFreeClear(pDataBlock->pTableMeta);
|
|
||||||
}
|
|
||||||
|
|
||||||
destroyBoundColumnInfo(&pDataBlock->boundColumnInfo);
|
destroyBoundColumnInfo(&pDataBlock->boundColumnInfo);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue