Skip to content

Commit 8234765

Browse files
authored
Copy recorder QoS profile to local variable so that temporary value isn't cleared (ros2#803)
Signed-off-by: Emerson Knapp <[email protected]>
1 parent 2b77beb commit 8234765

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rosbag2_transport/src/rosbag2_transport/recorder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,8 @@ void Recorder::warn_if_new_qos_for_subscribed_topic(const std::string & topic_na
280280
// Already warned about this topic
281281
return;
282282
}
283-
const auto & used_profile = existing_subscription->second->get_actual_qos().get_rmw_qos_profile();
283+
const auto actual_qos = existing_subscription->second->get_actual_qos();
284+
const auto & used_profile = actual_qos.get_rmw_qos_profile();
284285
auto publishers_info = this->get_publishers_info_by_topic(topic_name);
285286
for (const auto & info : publishers_info) {
286287
auto new_profile = info.qos_profile().get_rmw_qos_profile();

0 commit comments

Comments
 (0)