Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
827e84b1
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
827e84b1
编写于
6月 13, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:memory leak
上级
d8d6b6dd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
20 deletion
+20
-20
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+2
-2
source/dnode/mnode/impl/src/mndDef.c
source/dnode/mnode/impl/src/mndDef.c
+18
-18
未找到文件。
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
827e84b1
...
...
@@ -570,8 +570,8 @@ typedef struct {
SEpSet
epSet
;
}
SMqVgEp
;
//
SMqVgEp* tCloneSMqVgEp(const SMqVgEp* pVgEp);
//
void tDeleteSMqVgEp(SMqVgEp* pVgEp);
SMqVgEp
*
tCloneSMqVgEp
(
const
SMqVgEp
*
pVgEp
);
void
tDeleteSMqVgEp
(
SMqVgEp
*
pVgEp
);
int32_t
tEncodeSMqVgEp
(
void
**
buf
,
const
SMqVgEp
*
pVgEp
);
void
*
tDecodeSMqVgEp
(
const
void
*
buf
,
SMqVgEp
*
pVgEp
,
int8_t
sver
);
...
...
source/dnode/mnode/impl/src/mndDef.c
浏览文件 @
827e84b1
...
...
@@ -183,21 +183,21 @@ void tFreeStreamObj(SStreamObj *pStream) {
}
}
//
SMqVgEp *tCloneSMqVgEp(const SMqVgEp *pVgEp) {
//
SMqVgEp *pVgEpNew = taosMemoryMalloc(sizeof(SMqVgEp));
//
if (pVgEpNew == NULL) return NULL;
//
pVgEpNew->vgId = pVgEp->vgId;
//
//
pVgEpNew->qmsg = taosStrdup(pVgEp->qmsg);
//
pVgEpNew->epSet = pVgEp->epSet;
//
return pVgEpNew;
//
}
SMqVgEp
*
tCloneSMqVgEp
(
const
SMqVgEp
*
pVgEp
)
{
SMqVgEp
*
pVgEpNew
=
taosMemoryMalloc
(
sizeof
(
SMqVgEp
));
if
(
pVgEpNew
==
NULL
)
return
NULL
;
pVgEpNew
->
vgId
=
pVgEp
->
vgId
;
// pVgEpNew->qmsg = taosStrdup(pVgEp->qmsg);
pVgEpNew
->
epSet
=
pVgEp
->
epSet
;
return
pVgEpNew
;
}
//
void tDeleteSMqVgEp(SMqVgEp *pVgEp) {
//
if (pVgEp) {
//
//
taosMemoryFreeClear(pVgEp->qmsg);
//
taosMemoryFree(pVgEp);
//
}
//
}
void
tDeleteSMqVgEp
(
SMqVgEp
*
pVgEp
)
{
if
(
pVgEp
)
{
// taosMemoryFreeClear(pVgEp->qmsg);
taosMemoryFree
(
pVgEp
);
}
}
int32_t
tEncodeSMqVgEp
(
void
**
buf
,
const
SMqVgEp
*
pVgEp
)
{
int32_t
tlen
=
0
;
...
...
@@ -517,11 +517,11 @@ SMqSubscribeObj *tCloneSubscribeObj(const SMqSubscribeObj *pSub) {
pConsumerEp
=
(
SMqConsumerEp
*
)
pIter
;
SMqConsumerEp
newEp
=
{
.
consumerId
=
pConsumerEp
->
consumerId
,
.
vgs
=
taosArrayDup
(
pConsumerEp
->
vgs
,
NULL
),
.
vgs
=
taosArrayDup
(
pConsumerEp
->
vgs
,
(
__array_item_dup_fn_t
)
tCloneSMqVgEp
),
};
taosHashPut
(
pSubNew
->
consumerHash
,
&
newEp
.
consumerId
,
sizeof
(
int64_t
),
&
newEp
,
sizeof
(
SMqConsumerEp
));
}
pSubNew
->
unassignedVgs
=
taosArrayDup
(
pSub
->
unassignedVgs
,
NULL
);
pSubNew
->
unassignedVgs
=
taosArrayDup
(
pSub
->
unassignedVgs
,
(
__array_item_dup_fn_t
)
tCloneSMqVgEp
);
pSubNew
->
offsetRows
=
taosArrayDup
(
pSub
->
offsetRows
,
NULL
);
memcpy
(
pSubNew
->
dbName
,
pSub
->
dbName
,
TSDB_DB_FNAME_LEN
);
pSubNew
->
qmsg
=
taosStrdup
(
pSub
->
qmsg
);
...
...
@@ -534,11 +534,11 @@ void tDeleteSubscribeObj(SMqSubscribeObj *pSub) {
pIter
=
taosHashIterate
(
pSub
->
consumerHash
,
pIter
);
if
(
pIter
==
NULL
)
break
;
SMqConsumerEp
*
pConsumerEp
=
(
SMqConsumerEp
*
)
pIter
;
taosArrayDestroy
(
pConsumerEp
->
vgs
);
taosArrayDestroy
P
(
pConsumerEp
->
vgs
,
(
FDelete
)
tDeleteSMqVgEp
);
taosArrayDestroy
(
pConsumerEp
->
offsetRows
);
}
taosHashCleanup
(
pSub
->
consumerHash
);
taosArrayDestroy
(
pSub
->
unassignedVgs
);
taosArrayDestroy
P
(
pSub
->
unassignedVgs
,
(
FDelete
)
tDeleteSMqVgEp
);
taosMemoryFreeClear
(
pSub
->
qmsg
);
taosArrayDestroy
(
pSub
->
offsetRows
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录