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

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
  • Loading branch information
tfoote authored Sep 26, 2023
1 parent 9284d7c commit c213f8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rclcpp/src/rclcpp/signal_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ SignalHandler::get_logger()
SignalHandler &
SignalHandler::get_global_signal_handler()
{
static SignalHandler signal_handler;
return signal_handler;
static SignalHandler* signal_handler = new SignalHandler();
return *signal_handler;
}

bool
Expand Down

0 comments on commit c213f8d

Please sign in to comment.