Skip to content

Commit

Permalink
Attempt to call shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Oct 6, 2023
1 parent b068686 commit e3f243f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/mrc/include/mrc/node/rx_runnable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class RxRunnable : public runnable::RunnableWithContext<ContextT>, public RxSubs
RxRunnable() = default;
~RxRunnable() override = default;

void shutdown(ContextT& ctx);

private:
// implemented by node objects and will be final
virtual void on_shutdown_critical_section() = 0;
Expand All @@ -54,8 +56,6 @@ class RxRunnable : public runnable::RunnableWithContext<ContextT>, public RxSubs
void run(ContextT& ctx) final;
void on_state_update(const state_t& state) final;

void shutdown(ContextT& ctx);

rxcpp::composite_subscription m_subscription;
};

Expand Down
5 changes: 5 additions & 0 deletions cpp/mrc/src/internal/segment/builder_definition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ void BuilderDefinition::shutdown()
if (obj_prop->is_source() && !obj_prop->is_sink())
{
DVLOG(10) << "Destroying: " << name;
auto& ctx = Context<>::get_runtime_context();
auto source_object = std::dynamic_pointer_cast<Object<node::RxRunnable<decltype(ctx)>>>(obj_prop);
auto& runnable = source_object->object();
runnable.shutdown(ctx);

obj_prop->destroy();
}
}
Expand Down

0 comments on commit e3f243f

Please sign in to comment.