Skip to content

Commit

Permalink
Update SignalHandler get_global_signal_handler to avoid complex types…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>
Co-authored-by: William Woodall <[email protected]>
(cherry picked from commit 7c1143d)
  • Loading branch information
tfoote authored and mergify[bot] committed Sep 30, 2023
1 parent 37f38e3 commit 0677d3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rclcpp/src/rclcpp/signal_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 0677d3b

Please sign in to comment.