Skip to content

Commit

Permalink
ArduPilotPlugin: use make_shared to create object
Browse files Browse the repository at this point in the history
  • Loading branch information
khancyr committed Aug 12, 2024
1 parent 4af5cea commit c5f1916
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ArduPilotPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -964,8 +964,8 @@ void gz::sim::systems::ArduPilotPlugin::LoadRangeSensors(
};

// Wrap the std::function so we can register the callback
auto callbackWrapper = RangeOnMessageWrapperPtr(
new OnMessageWrapper<gz::msgs::LaserScan>(fn));
auto callbackWrapper =
std::make_shared<OnMessageWrapper<gz::msgs::LaserScan>>(fn);

auto callback = &OnMessageWrapper<gz::msgs::LaserScan>::OnMessage;

Expand Down

0 comments on commit c5f1916

Please sign in to comment.