diff --git a/source/libs/stream/inc/streamInt.h b/source/libs/stream/inc/streamInt.h
index ff3f35bfedd73b21ea0858f40dbec19c8b9eaab4..add893c8c7dfa7d04c8bef8dfbce4df204357d23 100644
--- a/source/libs/stream/inc/streamInt.h
+++ b/source/libs/stream/inc/streamInt.h
@@ -31,6 +31,12 @@ typedef struct {
void* timer;
} SStreamGlobalEnv;
+typedef struct {
+ SEpSet epset;
+ int32_t taskId;
+ SRpcMsg msg;
+} SStreamContinueExecInfo;
+
extern SStreamGlobalEnv streamEnv;
void streamRetryDispatchStreamBlock(SStreamTask* pTask, int64_t waitDuration);
diff --git a/source/libs/stream/src/streamDispatch.c b/source/libs/stream/src/streamDispatch.c
index 88af841f0570fe0ddb6bac41b11167f0fbe822f5..ca5d5994b71a37a1a20ec494d2324cc03d393df5 100644
--- a/source/libs/stream/src/streamDispatch.c
+++ b/source/libs/stream/src/streamDispatch.c
@@ -648,12 +648,6 @@ int32_t tDecodeCompleteHistoryDataMsg(SDecoder* pDecoder, SStreamCompleteHistory
return 0;
}
-typedef struct {
- SEpSet epset;
- int32_t taskId;
- SRpcMsg msg;
-} SStreamContinueExecInfo;
-
int32_t streamAddEndScanHistoryMsg(SStreamTask* pTask, SRpcHandleInfo* pRpcInfo, SStreamScanHistoryFinishReq* pReq) {
int32_t len = 0;
int32_t code = 0;
diff --git a/source/libs/stream/src/streamTask.c b/source/libs/stream/src/streamTask.c
index d54d5fa8b88b76d55d17bf44a6c5478db0d9c1c7..863c4ce0252e3b08aea5ba79b7ae4b2e624cdc13 100644
--- a/source/libs/stream/src/streamTask.c
+++ b/source/libs/stream/src/streamTask.c
@@ -13,6 +13,8 @@
* along with this program. If not, see .
*/
+#include
+#include
#include "executor.h"
#include "tstream.h"
#include "wal.h"
@@ -203,6 +205,11 @@ int32_t tDecodeStreamTask(SDecoder* pDecoder, SStreamTask* pTask) {
return 0;
}
+static void freeItem(void* p) {
+ SStreamContinueExecInfo* pInfo = p;
+ rpcFreeCont(pInfo->msg.pCont);
+}
+
void tFreeStreamTask(SStreamTask* pTask) {
qDebug("free s-task:%s", pTask->id.idStr);
@@ -252,7 +259,8 @@ void tFreeStreamTask(SStreamTask* pTask) {
}
if (pTask->pRspMsgList != NULL) {
- pTask->pRspMsgList = taosArrayDestroy(pTask->pRspMsgList);
+ taosArrayDestroyEx(pTask->pRspMsgList, freeItem);
+ pTask->pRspMsgList = NULL;
}
taosThreadMutexDestroy(&pTask->lock);