From 2161bca6495d57b7b2fbe043e43df450841ae331 Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Mon, 22 Jun 2020 14:20:20 -0300 Subject: [PATCH] Finalize init options in context. Signed-off-by: Michel Hidalgo --- rmw_fastrtps_cpp/src/rmw_init.cpp | 4 ++++ rmw_fastrtps_dynamic_cpp/src/rmw_init.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/rmw_fastrtps_cpp/src/rmw_init.cpp b/rmw_fastrtps_cpp/src/rmw_init.cpp index 9fda70589..09ee3744e 100644 --- a/rmw_fastrtps_cpp/src/rmw_init.cpp +++ b/rmw_fastrtps_cpp/src/rmw_init.cpp @@ -134,6 +134,10 @@ rmw_context_fini(rmw_context_t * context) RCUTILS_SET_ERROR_MSG("context has not been shutdown"); return RMW_RET_INVALID_ARGUMENT; } + rmw_ret_t ret = rmw_init_options_fini(&context->options); + if (RMW_RET_OK != ret) { + return ret; + } delete context->impl; *context = rmw_get_zero_initialized_context(); return RMW_RET_OK; diff --git a/rmw_fastrtps_dynamic_cpp/src/rmw_init.cpp b/rmw_fastrtps_dynamic_cpp/src/rmw_init.cpp index aedf8974d..ceb908ce0 100644 --- a/rmw_fastrtps_dynamic_cpp/src/rmw_init.cpp +++ b/rmw_fastrtps_dynamic_cpp/src/rmw_init.cpp @@ -133,6 +133,10 @@ rmw_context_fini(rmw_context_t * context) RCUTILS_SET_ERROR_MSG("context has not been shutdown"); return RMW_RET_INVALID_ARGUMENT; } + rmw_ret_t ret = rmw_init_options_fini(&context->options); + if (RMW_RET_OK != ret) { + return ret; + } delete context->impl; *context = rmw_get_zero_initialized_context(); return RMW_RET_OK;