fix(tsdb): fix memory leak.
This commit is contained in:
parent
3ca3dc54ae
commit
0c2273daf2
|
@ -75,6 +75,12 @@ void getLastBlockLoadInfo(SSttBlockLoadInfo *pLoadInfo, int64_t *blocks, double
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void freeTombBlock(void* param) {
|
||||||
|
STombBlock** pTombBlock = (STombBlock**) param;
|
||||||
|
tTombBlockDestroy(*pTombBlock);
|
||||||
|
taosMemoryFree(*pTombBlock);
|
||||||
|
}
|
||||||
|
|
||||||
void *destroyLastBlockLoadInfo(SSttBlockLoadInfo *pLoadInfo) {
|
void *destroyLastBlockLoadInfo(SSttBlockLoadInfo *pLoadInfo) {
|
||||||
if (pLoadInfo == NULL) {
|
if (pLoadInfo == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -91,6 +97,8 @@ void *destroyLastBlockLoadInfo(SSttBlockLoadInfo *pLoadInfo) {
|
||||||
taosArrayDestroy(pLoadInfo[i].aSttBlk);
|
taosArrayDestroy(pLoadInfo[i].aSttBlk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taosArrayDestroyEx(pLoadInfo->pTombBlockArray, freeTombBlock);
|
||||||
|
|
||||||
taosMemoryFree(pLoadInfo);
|
taosMemoryFree(pLoadInfo);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -566,7 +566,7 @@ static int32_t initFilesetIterator(SFilesetIter* pIter, TFileSetArray* pFileSetA
|
||||||
if (pLReader->pInfo == NULL) {
|
if (pLReader->pInfo == NULL) {
|
||||||
// here we ignore the first column, which is always be the primary timestamp column
|
// here we ignore the first column, which is always be the primary timestamp column
|
||||||
SBlockLoadSuppInfo* pInfo = &pReader->suppInfo;
|
SBlockLoadSuppInfo* pInfo = &pReader->suppInfo;
|
||||||
|
// todo dynamic number of stt
|
||||||
int32_t numOfStt = pReader->pTsdb->pVnode->config.sttTrigger;
|
int32_t numOfStt = pReader->pTsdb->pVnode->config.sttTrigger;
|
||||||
pLReader->pInfo = tCreateLastBlockLoadInfo(pReader->pSchema, &pInfo->colId[1], pInfo->numOfCols - 1, numOfStt);
|
pLReader->pInfo = tCreateLastBlockLoadInfo(pReader->pSchema, &pInfo->colId[1], pInfo->numOfCols - 1, numOfStt);
|
||||||
if (pLReader->pInfo == NULL) {
|
if (pLReader->pInfo == NULL) {
|
||||||
|
|
Loading…
Reference in New Issue