Skip to content

Commit

Permalink
Fix double delete in PILZ CIRC generation (#1229)
Browse files Browse the repository at this point in the history
  • Loading branch information
henningkayser authored May 10, 2022
1 parent 806cce4 commit 3aa74ec
Showing 1 changed file with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ std::unique_ptr<KDL::Path> PathCircleGenerator::circleFromCenter(const KDL::Fram
}
catch (KDL::Error_MotionPlanning&)
{
delete rot_interpo; // in case we could not construct the Path object, avoid
// a memory leak
KDL::epsilon = old_kdl_epsilon;
throw; // and pass the exception on to the caller
}
Expand Down Expand Up @@ -121,22 +119,9 @@ std::unique_ptr<KDL::Path> PathCircleGenerator::circleFromInterim(const KDL::Fra
}

KDL::RotationalInterpolation* rot_interpo = new KDL::RotationalInterpolation_SingleAxis();
try
{
return std::unique_ptr<KDL::Path>(
std::make_unique<KDL::Path_Circle>(start_pose, center_point, kdl_aux_point, goal_pose.M, alpha, rot_interpo,
eqradius, true /* take ownership of RotationalInterpolation */));
}
catch (KDL::Error_MotionPlanning&) // LCOV_EXCL_START // The cases where
// KDL would throw are already handled
// above,
// we keep these lines to be safe
{
delete rot_interpo; // in case we could not construct the Path object, avoid
// a memory leak
throw; // and pass the exception on to the caller
// LCOV_EXCL_STOP
}
return std::unique_ptr<KDL::Path>(
std::make_unique<KDL::Path_Circle>(start_pose, center_point, kdl_aux_point, goal_pose.M, alpha, rot_interpo,
eqradius, true /* take ownership of RotationalInterpolation */));
}

double PathCircleGenerator::cosines(const double a, const double b, const double c)
Expand Down

0 comments on commit 3aa74ec

Please sign in to comment.