fix(query): eliminate memory leak.
This commit is contained in:
parent
addd65f222
commit
f867e8ea91
|
@ -225,6 +225,7 @@ typedef struct SExecTaskInfo {
|
|||
char* sql; // query sql string
|
||||
jmp_buf env; // jump to this position when error happens.
|
||||
EOPTR_EXEC_MODEL execModel; // operator execution model [batch model|stream model]
|
||||
struct SSubplan *plan;
|
||||
struct SOperatorInfo* pRoot;
|
||||
} SExecTaskInfo;
|
||||
|
||||
|
|
|
@ -36,21 +36,6 @@ typedef struct STaskMgmt {
|
|||
bool closed;
|
||||
} STaskMgmt;
|
||||
|
||||
static void taskMgmtKillTaskFn(void* handle, void* param1) {
|
||||
void** fp = (void**)handle;
|
||||
qKillTask(*fp);
|
||||
}
|
||||
|
||||
static void freeqinfoFn(void *qhandle) {
|
||||
void** handle = qhandle;
|
||||
if (handle == NULL || *handle == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
qKillTask(*handle);
|
||||
qDestroyTask(*handle);
|
||||
}
|
||||
|
||||
int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId, SSubplan* pSubplan,
|
||||
qTaskInfo_t* pTaskInfo, DataSinkHandle* handle, EOPTR_EXEC_MODEL model) {
|
||||
assert(readHandle != NULL && pSubplan != NULL);
|
||||
|
|
|
@ -5209,6 +5209,7 @@ int32_t createExecTaskInfoImpl(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SRead
|
|||
goto _complete;
|
||||
}
|
||||
|
||||
(*pTaskInfo)->plan = pPlan;
|
||||
return code;
|
||||
|
||||
_complete:
|
||||
|
@ -5311,7 +5312,6 @@ void doDestroyTask(SExecTaskInfo* pTaskInfo) {
|
|||
// taosArrayDestroy(pTaskInfo->summary.queryProfEvents);
|
||||
// taosHashCleanup(pTaskInfo->summary.operatorProfResults);
|
||||
|
||||
destroyOperatorInfo(pTaskInfo->pRoot);
|
||||
taosMemoryFreeClear(pTaskInfo->sql);
|
||||
taosMemoryFreeClear(pTaskInfo->id.str);
|
||||
taosMemoryFreeClear(pTaskInfo);
|
||||
|
|
Loading…
Reference in New Issue