fix mem leak issue
This commit is contained in:
parent
0e6850708e
commit
832a990c8f
|
@ -122,6 +122,7 @@ SParamInfo* tscAddParamToDataBlock(STableDataBlocks* pDataBlock, char type, uint
|
||||||
uint32_t offset);
|
uint32_t offset);
|
||||||
|
|
||||||
void* tscDestroyBlockArrayList(SArray* pDataBlockList);
|
void* tscDestroyBlockArrayList(SArray* pDataBlockList);
|
||||||
|
void* tscDestroyUdfArrayList(SArray* pUdfList);
|
||||||
void* tscDestroyBlockHashTable(SHashObj* pBlockHashTable, bool removeMeta);
|
void* tscDestroyBlockHashTable(SHashObj* pBlockHashTable, bool removeMeta);
|
||||||
|
|
||||||
int32_t tscCopyDataBlockToPayload(SSqlObj* pSql, STableDataBlocks* pDataBlock);
|
int32_t tscCopyDataBlockToPayload(SSqlObj* pSql, STableDataBlocks* pDataBlock);
|
||||||
|
|
|
@ -435,6 +435,7 @@ void tscResetSqlCmd(SSqlCmd* pCmd, bool removeMeta) {
|
||||||
|
|
||||||
pCmd->pTableBlockHashList = tscDestroyBlockHashTable(pCmd->pTableBlockHashList, removeMeta);
|
pCmd->pTableBlockHashList = tscDestroyBlockHashTable(pCmd->pTableBlockHashList, removeMeta);
|
||||||
pCmd->pDataBlocks = tscDestroyBlockArrayList(pCmd->pDataBlocks);
|
pCmd->pDataBlocks = tscDestroyBlockArrayList(pCmd->pDataBlocks);
|
||||||
|
pCmd->pUdfInfo = tscDestroyUdfArrayList(pCmd->pUdfInfo);
|
||||||
tscFreeQueryInfo(pCmd, removeMeta);
|
tscFreeQueryInfo(pCmd, removeMeta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,6 +611,26 @@ void* tscDestroyBlockArrayList(SArray* pDataBlockList) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* tscDestroyUdfArrayList(SArray* pUdfList) {
|
||||||
|
if (pUdfList == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t size = taosArrayGetSize(pUdfList);
|
||||||
|
for (int32_t i = 0; i < size; i++) {
|
||||||
|
SUdfInfo* udf = taosArrayGet(pUdfList, i);
|
||||||
|
if (udf) {
|
||||||
|
tfree(udf->content);
|
||||||
|
tfree(udf->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
taosArrayDestroy(pUdfList);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void* tscDestroyBlockHashTable(SHashObj* pBlockHashTable, bool removeMeta) {
|
void* tscDestroyBlockHashTable(SHashObj* pBlockHashTable, bool removeMeta) {
|
||||||
if (pBlockHashTable == NULL) {
|
if (pBlockHashTable == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue