From 7c1143dc1502d5dda99a3dfa17124a72dbaea90c Mon Sep 17 00:00:00 2001 From: Tully Foote Date: Fri, 29 Sep 2023 16:13:43 -0700 Subject: [PATCH] Update SignalHandler get_global_signal_handler to avoid complex types in static memory (#2316) * Update SignalHandler get_global_signal_handler to avoid complex types in static memory This was flagged by msan as a problem. There's a description of why this is a potential problem here: https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables Signed-off-by: Tully Foote Co-authored-by: William Woodall --- rclcpp/src/rclcpp/signal_handler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rclcpp/src/rclcpp/signal_handler.cpp b/rclcpp/src/rclcpp/signal_handler.cpp index 7085c63bdf..cf26d06df4 100644 --- a/rclcpp/src/rclcpp/signal_handler.cpp +++ b/rclcpp/src/rclcpp/signal_handler.cpp @@ -113,7 +113,7 @@ SignalHandler::get_logger() SignalHandler & SignalHandler::get_global_signal_handler() { - static SignalHandler signal_handler; + static SignalHandler & signal_handler = *new SignalHandler(); return signal_handler; }