Skip to content

Commit

Permalink
[core] Check pipeline template integrity after the construction funct…
Browse files Browse the repository at this point in the history
…ion returns
  • Loading branch information
pajama-coder committed Jun 16, 2024
1 parent c92f39c commit 159d4e8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/api/pipeline-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ auto PipelineDesigner::make_pipeline_layout(pjs::Context &ctx, pjs::Function *bu
auto worker = static_cast<Worker*>(ctx.instance());
auto pl = PipelineLayout::make(worker);
auto pd = PipelineDesigner::make(pl);
pjs::Value arg(pd), ret;
(*builder)(ctx, 1, &arg, ret);
pd->close();
try {
pjs::Value arg(pd), ret;
(*builder)(ctx, 1, &arg, ret);
pd->close();
} catch (std::runtime_error &err) {
ctx.error(err);
}
if (ctx.ok()) return pl;
pl->retain();
pl->release();
Expand Down Expand Up @@ -131,6 +135,7 @@ void PipelineDesigner::to(PipelineLayout *layout) {
}

void PipelineDesigner::close() {
check_integrity();
m_current_filter = nullptr;
m_current_joint_filter = nullptr;
m_layout = nullptr;
Expand Down

0 comments on commit 159d4e8

Please sign in to comment.