From 46ec8bb5df0f5b84ef300670f31b45e7bbf2e548 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Wed, 11 Nov 2020 10:15:27 -0800 Subject: [PATCH] Fix NodeOptions copy constructor (#1376) (#1451) * Fix NodeOptions copy constructor (#1376) Signed-off-by: Ivan Santiago Paunovic * Remove rosout_qos assignment Not applicable in Foxy. Signed-off-by: Jacob Perron Co-authored-by: Ivan Santiago Paunovic --- rclcpp/src/rclcpp/node_options.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rclcpp/src/rclcpp/node_options.cpp b/rclcpp/src/rclcpp/node_options.cpp index 0f4f274..fc8bd29 100644 --- a/rclcpp/src/rclcpp/node_options.cpp +++ b/rclcpp/src/rclcpp/node_options.cpp @@ -67,6 +67,7 @@ NodeOptions & NodeOptions::operator=(const NodeOptions & other) { if (this != &other) { + this->node_options_.reset(); this->context_ = other.context_; this->arguments_ = other.arguments_; this->parameter_overrides_ = other.parameter_overrides_; @@ -75,11 +76,13 @@ NodeOptions::operator=(const NodeOptions & other) this->use_intra_process_comms_ = other.use_intra_process_comms_; this->enable_topic_statistics_ = other.enable_topic_statistics_; this->start_parameter_services_ = other.start_parameter_services_; - this->allocator_ = other.allocator_; + this->start_parameter_event_publisher_ = other.start_parameter_event_publisher_; + this->parameter_event_qos_ = other.parameter_event_qos_; + this->parameter_event_publisher_options_ = other.parameter_event_publisher_options_; this->allow_undeclared_parameters_ = other.allow_undeclared_parameters_; this->automatically_declare_parameters_from_overrides_ = other.automatically_declare_parameters_from_overrides_; - this->node_options_.reset(); + this->allocator_ = other.allocator_; } return *this; }