From 5b9b8f0400e53a1c47cba2818ee494b01d939193 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Fri, 18 Dec 2015 08:34:48 -0800 Subject: [PATCH 1/2] add missing const --- rmw_fastrtps_cpp/src/functions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmw_fastrtps_cpp/src/functions.cpp b/rmw_fastrtps_cpp/src/functions.cpp index 9b09bb3a3..1307c6d75 100644 --- a/rmw_fastrtps_cpp/src/functions.cpp +++ b/rmw_fastrtps_cpp/src/functions.cpp @@ -1468,7 +1468,7 @@ extern "C" rmw_guard_conditions_t *guard_conditions, rmw_services_t *services, rmw_clients_t *clients, - rmw_time_t *wait_timeout) + const rmw_time_t *wait_timeout) { std::mutex conditionMutex; std::condition_variable conditionVariable; From fa154e20b2d32fc3ced63205bbf93bba042cb2a6 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Fri, 18 Dec 2015 08:52:31 -0800 Subject: [PATCH 2/2] fix node handle creation --- rmw_fastrtps_cpp/src/functions.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rmw_fastrtps_cpp/src/functions.cpp b/rmw_fastrtps_cpp/src/functions.cpp index 1307c6d75..1d4e12616 100644 --- a/rmw_fastrtps_cpp/src/functions.cpp +++ b/rmw_fastrtps_cpp/src/functions.cpp @@ -1,3 +1,4 @@ +#include "rmw/allocators.h" #include #include #include @@ -279,7 +280,11 @@ extern "C" return NULL; } - rmw_node_t *node_handle = new rmw_node_t; + rmw_node_t * node_handle = rmw_node_allocate(); + if (!node_handle) { + RMW_SET_ERROR_MSG("failed to allocate rmw_node_t"); + return NULL; + } node_handle->implementation_identifier = eprosima_fastrtps_identifier; node_handle->data = participant;