Unverified Commit c7bef7ad authored by stonneau's avatar stonneau Committed by GitHub
Browse files

Merge pull request #11 from JasonChmn/Topic/AddDestructor

[Fix] add destructor to avoid memory leak.
parents c84717bc 1cdd40bf
Pipeline #13267 passed with stage
in 1 minute and 49 seconds
......@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment