Skip to content
Snippets Groups Projects
Commit 1cdd40bf authored by Jason Chemin's avatar Jason Chemin
Browse files

[Fix] add destructor to avoid memory leak.

parent 5e2c0e81
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,8 @@ class CENTROIDAL_DYNAMICS_DLLAPI Equilibrium {
Equilibrium(const Equilibrium& other);
~Equilibrium();
/**
* @brief Returns the useWarmStart flag.
* @return True if the LP solver is allowed to use warm start, false otherwise.
......
......@@ -51,6 +51,8 @@ class CENTROIDAL_DYNAMICS_DLLAPI Solver_LP_abstract {
m_useWarmStart = true;
}
virtual ~Solver_LP_abstract() {}
/**
* @brief Create a new LP solver of the specified type.
* @param solverType Type of LP solver.
......
......@@ -25,6 +25,8 @@ class CENTROIDAL_DYNAMICS_DLLAPI Solver_LP_qpoases : public Solver_LP_abstract {
public:
Solver_LP_qpoases();
virtual ~Solver_LP_qpoases() {}
/** Solve the linear program
* minimize c' x
* subject to Alb <= A x <= Aub
......
......@@ -72,6 +72,10 @@ Equilibrium::Equilibrium(const string& name, const double mass, const unsigned i
m_D.block<3, 3>(3, 0) = crossMatrix(-m_mass * m_gravity);
}
Equilibrium::~Equilibrium(){
delete m_solver;
}
bool Equilibrium::computeGenerators(Cref_matrixX3 contactPoints, Cref_matrixX3 contactNormals,
double frictionCoefficient, const bool perturbate) {
long int c = contactPoints.rows();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment