提交 fc3e783e 编写于 作者: wmmhello's avatar wmmhello

fix json map destory error

上级 c4ad7a8b
......@@ -868,7 +868,7 @@ static STable *tsdbCreateTableFromCfg(STableCfg *pCfg, bool isSuper, STable *pST
tsdbFreeTable(pTable);
return NULL;
}
taosHashSetFreeFp(pTable->jsonKeyMap, (_hash_free_fn_t)taosArrayDestroy);
taosHashSetFreeFp(pTable->jsonKeyMap, taosArrayDestroyForHash);
}else{
pTable->pIndex = tSkipListCreate(TSDB_SUPER_TABLE_SL_LEVEL, colType(pCol), (uint8_t)(colBytes(pCol)), NULL,
SL_ALLOW_DUP_KEY, getTagIndexKey);
......
......@@ -178,6 +178,12 @@ void taosArrayClear(SArray* pArray);
*/
void* taosArrayDestroy(SArray* pArray);
/**
* destroy array list for hash
* @param pArray
*/
void taosArrayDestroyForHash(void* para);
/**
*
* @param pArray
......
......@@ -288,6 +288,19 @@ void* taosArrayDestroy(SArray* pArray) {
return NULL;
}
void taosArrayDestroyForHash(void* para) {
SArray** ppArray = (SArray**)para;
if(ppArray == NULL) return;
SArray* pArray = *ppArray;
if (pArray) {
tfree(pArray->pData);
tfree(pArray);
}
return;
}
void taosArrayDestroyEx(SArray* pArray, void (*fp)(void*)) {
if (pArray == NULL) {
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册