Skip to content

Commit

Permalink
fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
darionyaphet committed Mar 31, 2022
1 parent 9e7cd06 commit 03de0d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/meta/test/JobManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ TEST_F(JobManagerTest, DownloadJob) {
EXPECT_CALL(adminClient, addTask(_, _, _, _, _, _, _))
.WillOnce(Return(ByMove(folly::makeFuture<Status>(Status::OK()))));

auto executor =
new DownloadJobExecutor(space, job.getJobId(), kv.get(), &adminClient, job.getParas());
auto executor = make_unique<DownloadJobExecutor>(
space, job.getJobId(), kv.get(), &adminClient, job.getParas());
executor->helper_ = std::make_unique<meta::MockHdfsOKHelper>();

ASSERT_TRUE(executor->check());
Expand All @@ -163,7 +163,7 @@ TEST_F(JobManagerTest, IngestJob) {
EXPECT_CALL(adminClient, addTask(_, _, _, _, _, _, _))
.WillOnce(Return(ByMove(folly::makeFuture<Status>(Status::OK()))));
auto executor =
new IngestJobExecutor(space, job.getJobId(), kv.get(), &adminClient, job.getParas());
make_unique<IngestJobExecutor>(space, job.getJobId(), kv.get(), &adminClient, job.getParas());

ASSERT_TRUE(executor->check());
auto code = executor->prepare();
Expand Down
2 changes: 2 additions & 0 deletions src/parser/parser.yy
Original file line number Diff line number Diff line change
Expand Up @@ -3241,6 +3241,7 @@ download_sentence
meta::cpp2::JobType::DOWNLOAD);
sentence->addPara(*$3);
$$ = sentence;
delete $3;
}
;

Expand Down Expand Up @@ -3280,6 +3281,7 @@ admin_job_sentence
meta::cpp2::JobType::DOWNLOAD);
sentence->addPara(*$5);
$$ = sentence;
delete($5);
}
| KW_SUBMIT KW_JOB KW_INGEST {
auto sentence = new AdminJobSentence(meta::cpp2::JobOp::ADD,
Expand Down

0 comments on commit 03de0d9

Please sign in to comment.