提交 4142ec3e 编写于 作者: H Haojun Liao

[td-2859] refactor and fix memory leaks.

上级 70a02863
......@@ -4409,6 +4409,11 @@ SArray* getResultGroupCheckColumns(SQueryAttr* pQuery) {
return pOrderColumns;
}
static void destroyGlobalAggOperatorInfo(void* param, int32_t numOfOutput) {
SMultiwayMergeInfo *pInfo = (SMultiwayMergeInfo*) param;
destroyBasicOperatorInfo(&pInfo->binfo, numOfOutput);
}
SOperatorInfo* createGlobalAggregateOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream,
SExprInfo* pExpr, int32_t numOfOutput, void* param) {
SMultiwayMergeInfo* pInfo = calloc(1, sizeof(SMultiwayMergeInfo));
......@@ -4471,7 +4476,7 @@ SOperatorInfo* createGlobalAggregateOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv,
pOperator->pRuntimeEnv = pRuntimeEnv;
pOperator->exec = doGlobalAggregate;
pOperator->cleanup = destroyBasicOperatorInfo;
pOperator->cleanup = destroyGlobalAggOperatorInfo;
return pOperator;
}
......
......@@ -744,7 +744,7 @@ void destroyAllSqlNode(SArray *pList) {
size_t size = taosArrayGetSize(pList);
for(int32_t i = 0; i < size; ++i) {
SSqlNode *pNode = taosArrayGetP(pList, 0);
SSqlNode *pNode = taosArrayGetP(pList, i);
destroySqlNode(pNode);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册