Merge pull request #29957 from taosdata/fix/ly_stream_main_1

fix(stream): fix mem leak
This commit is contained in:
Simon Guan 2025-02-28 09:16:06 +08:00 committed by GitHub
commit 6d9e811693
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 7 deletions

View File

@ -234,6 +234,11 @@ int32_t updateEventWindowInfo(SStreamAggSupporter* pAggSup, SEventWindowInfo* pW
pWin->ekey = pTsData[i];
pWinInfo->pWinFlag->endFlag = ends[i];
} else if (pWin->ekey == pTsData[i]) {
if (pWinInfo->pWinFlag->endFlag == true && ends[i] == false) {
(*pWinRow) = i + 1 - start;
*pRebuild = true;
goto _end;
}
pWinInfo->pWinFlag->endFlag |= ends[i];
} else if (ends[i] && !pWinInfo->pWinFlag->endFlag) {
*pRebuild = true;

View File

@ -479,14 +479,12 @@ void destroyFlusedppPos(void* ppRes) {
}
void clearGroupResInfo(SGroupResInfo* pGroupResInfo) {
if (pGroupResInfo->freeItem) {
int32_t size = taosArrayGetSize(pGroupResInfo->pRows);
for (int32_t i = pGroupResInfo->index; i < size; i++) {
void* pPos = taosArrayGetP(pGroupResInfo->pRows, i);
destroyFlusedPos(pPos);
}
pGroupResInfo->freeItem = false;
int32_t size = taosArrayGetSize(pGroupResInfo->pRows);
for (int32_t i = pGroupResInfo->index; i < size; i++) {
void* pPos = taosArrayGetP(pGroupResInfo->pRows, i);
destroyFlusedPos(pPos);
}
pGroupResInfo->freeItem = false;
taosArrayDestroy(pGroupResInfo->pRows);
pGroupResInfo->pRows = NULL;
pGroupResInfo->index = 0;