Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy topic name before deleting subscription. #105

Merged
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
4 changes: 2 additions & 2 deletions r2r/src/subscribers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ where
drop(Box::from_raw(handle_ptr));
} else {
let topic_str = rcl_subscription_get_topic_name(handle_ptr);
let topic = CStr::from_ptr(topic_str);
let topic = CStr::from_ptr(topic_str).to_str().expect("to_str() call failed").to_owned();
drop(Box::from_raw(handle_ptr));

let err_str = rcutils_get_error_string();
Expand All @@ -118,7 +118,7 @@ where
panic!(
"rcl_return_loaned_message_from_subscription() \
failed for subscription on topic {}: {}",
topic.to_str().expect("to_str() call failed"),
topic,
error_msg.to_str().expect("to_str() call failed")
);
}
Expand Down