Skip to content

Commit

Permalink
fix: wrap a short-lived keyexpr in a std::string (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanYuYuan authored Dec 23, 2024
1 parent 4b26a58 commit 57a6b4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_service_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ std::shared_ptr<ServiceData> ServiceData::make(
RMW_ZENOH_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"Unable to obtain ServiceData from data for %s.",
query.get_keyexpr().as_string_view());
std::string(query.get_keyexpr().as_string_view()).c_str());
return;
}

Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ bool SubscriptionData::init()
RMW_ZENOH_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"Unable to obtain SubscriptionData from data for %s.",
sample.get_keyexpr().as_string_view());
std::string(sample.get_keyexpr().as_string_view()).c_str());
return;
}

Expand Down

0 comments on commit 57a6b4b

Please sign in to comment.