Skip to content

Commit

Permalink
Merge pull request #2950 from randaz81/fakeLaserWithMotor_fix
Browse files Browse the repository at this point in the history
Valgrind fix fo FakeLaserWithMotor device
  • Loading branch information
randaz81 authored Mar 3, 2023
2 parents 35277a5 + ceb11b0 commit bbb01fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/devices/fakeLaserWithMotor/fakeLaserWithMotor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ bool FakeLaserWithMotor::open(yarp::os::Searchable& config)
bool FakeLaserWithMotor::close()
{
PeriodicThread::stop();
dealloc();
m_rpcPort.interrupt();
m_rpcPort.close();

return true;
}
Expand Down
6 changes: 3 additions & 3 deletions src/devices/fakeLaserWithMotor/fakeLaserWithMotor_motors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,14 @@ bool FakeLaserWithMotor::alloc(int nj)

bool FakeLaserWithMotor::dealloc()
{
checkAndDestroy(_axisName);
checkAndDestroy(_jointType);
checkAndDestroy(_controlModes);
checkAndDestroy(_encoders);
checkAndDestroy(_posCtrl_references);
checkAndDestroy(_command_speeds);
checkAndDestroy(_ref_speeds);
checkAndDestroy(_command_speeds);
checkAndDestroy(_ref_accs);
checkAndDestroy(_axisName);
checkAndDestroy(_jointType);
return true;
}

Expand Down

0 comments on commit bbb01fc

Please sign in to comment.