Skip to content

Commit

Permalink
fixed memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Randazzo authored and randaz81 committed Mar 8, 2023
1 parent 8456ce2 commit 420465c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ bool Rangefinder2D_nwc_ros2::open(yarp::os::Searchable &config)
bool Rangefinder2D_nwc_ros2::close()
{
yCInfo(RANGEFINDER2D_NWC_ROS2, "closing...");
delete m_subscriber;
delete m_spinner;
yCInfo(RANGEFINDER2D_NWC_ROS2, "closed");
return true;
Expand Down
2 changes: 2 additions & 0 deletions src/devices/rgbdSensor_nwc_ros2/RgbdSensor_nwc_ros2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ bool RgbdSensor_nwc_ros2::open(yarp::os::Searchable& config)
bool RgbdSensor_nwc_ros2::close()
{
yCInfo(RGBDSENSOR_NWC_ROS2, "closing...");
delete m_sub1;
delete m_sub2;
delete m_spinner;
yCInfo(RGBDSENSOR_NWC_ROS2, "closed");
return true;
Expand Down

0 comments on commit 420465c

Please sign in to comment.