Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ template <class NODETYPE>
void NodeCanopenBaseDriver<NODETYPE>::deactivate(bool called_from_base)
{
nmt_state_publisher_thread_.join();
poll_timer_->cancel();
if (poll_timer_) {
poll_timer_->cancel();
}
emcy_queue_.reset();
rpdo_queue_.reset();
if (diagnostic_enabled_.load())
Expand Down
2 changes: 2 additions & 0 deletions canopen_core/include/canopen_core/device_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class DeviceContainer : public rclcpp_components::ComponentManager
lifecycle_operation_ = false;
}

~DeviceContainer() override { shutdown(); }

/**
* @brief Executes the initialisation
*
Expand Down
5 changes: 4 additions & 1 deletion canopen_ros2_control/src/canopen_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ void CanopenSystem::clean()
device_container_.reset();
executor_.reset();

init_thread_->join();
if (init_thread_->joinable())
{
init_thread_->join();
}
init_thread_.reset();

executor_.reset();
Expand Down