Skip to content

Commit

Permalink
cleanup, added nullptr check to node.cpp, lifecyclenode.cpp
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Pande <aditya050995@gmail.com>
  • Loading branch information
adityapande-1995 committed Aug 9, 2021
1 parent e6733bf commit 58174d0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion rclcpp/include/rclcpp/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
#include "rclcpp/timer.hpp"
#include "rclcpp/visibility_control.hpp"


namespace rclcpp
{

Expand Down
2 changes: 0 additions & 2 deletions rclcpp/include/rclcpp/node_interfaces/node_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#ifndef RCLCPP__NODE_INTERFACES__NODE_BASE_HPP_
#define RCLCPP__NODE_INTERFACES__NODE_BASE_HPP_

#include <atomic>
#include <functional>
#include <memory>
#include <mutex>
#include <string>
Expand Down
4 changes: 3 additions & 1 deletion rclcpp/src/rclcpp/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,5 +610,7 @@ void Node::for_each_callback_group(
const node_interfaces::NodeBaseInterface::CallbackGroupFunction & func)
{
auto node_base = std::dynamic_pointer_cast<rclcpp::node_interfaces::NodeBase>(node_base_);
node_base->for_each_callback_group(func);
if (!node_base) {
node_base->for_each_callback_group(func);
}
}
4 changes: 3 additions & 1 deletion rclcpp_lifecycle/src/lifecycle_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,9 @@ LifecycleNode::for_each_callback_group(
const rclcpp::node_interfaces::NodeBaseInterface::CallbackGroupFunction & func)
{
auto node_base = std::dynamic_pointer_cast<rclcpp::node_interfaces::NodeBase>(node_base_);
node_base->for_each_callback_group(func);
if (!node_base) {
node_base->for_each_callback_group(func);
}
}

} // namespace rclcpp_lifecycle

0 comments on commit 58174d0

Please sign in to comment.