提交 4d83118f 编写于 作者: H Haojun Liao

fix(stream): fix memory leak.

上级 70b45a4c
......@@ -635,6 +635,7 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) {
pTask->freeFp = (_free_reader_fn_t)tqCloseReader;
SArray* pList = qGetQueriedTableListInfo(pTask->exec.pExecutor);
tqReaderAddTbUidList(pTask->exec.pTqReader, pList);
taosArrayDestroy(pList);
}
streamSetupTrigger(pTask);
......
......@@ -9,7 +9,7 @@ target_include_directories(
target_link_libraries(
stream
PUBLIC tdb
PRIVATE os util transport qcom executor
PRIVATE os util transport qcom executor wal
)
if(${BUILD_TEST})
......
......@@ -15,6 +15,7 @@
#include "executor.h"
#include "tstream.h"
#include "wal.h"
SStreamTask* tNewStreamTask(int64_t streamId) {
SStreamTask* pTask = (SStreamTask*)taosMemoryCalloc(1, sizeof(SStreamTask));
......@@ -191,6 +192,10 @@ void tFreeStreamTask(SStreamTask* pTask) {
pTask->exec.pTqReader = NULL;
}
if (pTask->exec.pWalReader != NULL) {
walCloseReader(pTask->exec.pWalReader);
}
taosArrayDestroyP(pTask->childEpInfo, taosMemoryFree);
if (pTask->outputType == TASK_OUTPUT__TABLE) {
tDeleteSSchemaWrapper(pTask->tbSink.pSchemaWrapper);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册