fix memory leak
This commit is contained in:
parent
9531cba834
commit
21ea1e3735
|
@ -44,6 +44,7 @@ typedef struct {
|
||||||
TSKEY maxKey;
|
TSKEY maxKey;
|
||||||
TABLEID tbid[1];
|
TABLEID tbid[1];
|
||||||
bool hasTSData;
|
bool hasTSData;
|
||||||
|
|
||||||
bool skipTsRow;
|
bool skipTsRow;
|
||||||
SHashObj *pColCmprObj;
|
SHashObj *pColCmprObj;
|
||||||
} ctx[1];
|
} ctx[1];
|
||||||
|
@ -116,7 +117,6 @@ static int32_t tsdbCommitTSData(SCommitter2 *committer) {
|
||||||
|
|
||||||
committer->ctx->tbid->suid = 0;
|
committer->ctx->tbid->suid = 0;
|
||||||
committer->ctx->tbid->uid = 0;
|
committer->ctx->tbid->uid = 0;
|
||||||
|
|
||||||
for (SRowInfo *row; (row = tsdbIterMergerGetData(committer->dataIterMerger)) != NULL;) {
|
for (SRowInfo *row; (row = tsdbIterMergerGetData(committer->dataIterMerger)) != NULL;) {
|
||||||
if (row->uid != committer->ctx->tbid->uid) {
|
if (row->uid != committer->ctx->tbid->uid) {
|
||||||
committer->ctx->tbid->suid = row->suid;
|
committer->ctx->tbid->suid = row->suid;
|
||||||
|
@ -284,7 +284,7 @@ static int32_t tsdbCommitOpenIter(SCommitter2 *committer) {
|
||||||
config.from->version = VERSION_MIN;
|
config.from->version = VERSION_MIN;
|
||||||
config.from->key = (SRowKey){
|
config.from->key = (SRowKey){
|
||||||
.ts = committer->ctx->minKey,
|
.ts = committer->ctx->minKey,
|
||||||
.numOfPKs = 0, // TODO: support multiple primary keys
|
.numOfPKs = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
code = tsdbIterOpen(&config, &iter);
|
code = tsdbIterOpen(&config, &iter);
|
||||||
|
@ -760,7 +760,9 @@ int32_t tsdbCommitCommit(STsdb *tsdb) {
|
||||||
|
|
||||||
if (tsdb->imem) {
|
if (tsdb->imem) {
|
||||||
SMemTable *pMemTable = tsdb->imem;
|
SMemTable *pMemTable = tsdb->imem;
|
||||||
|
|
||||||
taosThreadMutexLock(&tsdb->mutex);
|
taosThreadMutexLock(&tsdb->mutex);
|
||||||
|
|
||||||
if ((code = tsdbFSEditCommit(tsdb->pFS))) {
|
if ((code = tsdbFSEditCommit(tsdb->pFS))) {
|
||||||
taosThreadMutexUnlock(&tsdb->mutex);
|
taosThreadMutexUnlock(&tsdb->mutex);
|
||||||
TSDB_CHECK_CODE(code, lino, _exit);
|
TSDB_CHECK_CODE(code, lino, _exit);
|
||||||
|
@ -775,6 +777,8 @@ int32_t tsdbCommitCommit(STsdb *tsdb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
taosThreadMutexUnlock(&tsdb->mutex);
|
taosThreadMutexUnlock(&tsdb->mutex);
|
||||||
|
|
||||||
|
tsdbCommitInfoDestroy(tsdb);
|
||||||
tsdbUnrefMemTable(pMemTable, NULL, true);
|
tsdbUnrefMemTable(pMemTable, NULL, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue