log error message instead of throwing exception in destructor (#535)
This commit is contained in:
parent
e409e44413
commit
45d74ba4dc
1 changed files with 5 additions and 1 deletions
|
@ -25,6 +25,8 @@
|
||||||
#include "rclcpp/macros.hpp"
|
#include "rclcpp/macros.hpp"
|
||||||
#include "rclcpp/visibility_control.hpp"
|
#include "rclcpp/visibility_control.hpp"
|
||||||
|
|
||||||
|
#include "rcutils/logging_macros.h"
|
||||||
|
|
||||||
#include "rmw/serialized_message.h"
|
#include "rmw/serialized_message.h"
|
||||||
|
|
||||||
namespace rclcpp
|
namespace rclcpp
|
||||||
|
@ -96,7 +98,9 @@ public:
|
||||||
auto ret = rmw_serialized_message_fini(msg);
|
auto ret = rmw_serialized_message_fini(msg);
|
||||||
delete msg;
|
delete msg;
|
||||||
if (ret != RCL_RET_OK) {
|
if (ret != RCL_RET_OK) {
|
||||||
rclcpp::exceptions::throw_from_rcl_error(ret, "leaking memory");
|
RCUTILS_LOG_ERROR_NAMED(
|
||||||
|
"rclcpp",
|
||||||
|
"failed to destroy serialized message: %s", rcl_get_error_string_safe());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue