Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
Pipeline #13267 passed with warnings
...@@ -97,6 +97,8 @@ class CENTROIDAL_DYNAMICS_DLLAPI Equilibrium { ...@@ -97,6 +97,8 @@ class CENTROIDAL_DYNAMICS_DLLAPI Equilibrium {
Equilibrium(const Equilibrium& other); Equilibrium(const Equilibrium& other);
~Equilibrium();
/** /**
* @brief Returns the useWarmStart flag. * @brief Returns the useWarmStart flag.
* @return True if the LP solver is allowed to use warm start, false otherwise. * @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 { ...@@ -51,6 +51,8 @@ class CENTROIDAL_DYNAMICS_DLLAPI Solver_LP_abstract {
m_useWarmStart = true; m_useWarmStart = true;
} }
virtual ~Solver_LP_abstract() {}
/** /**
* @brief Create a new LP solver of the specified type. * @brief Create a new LP solver of the specified type.
* @param solverType Type of LP solver. * @param solverType Type of LP solver.
......
...@@ -25,6 +25,8 @@ class CENTROIDAL_DYNAMICS_DLLAPI Solver_LP_qpoases : public Solver_LP_abstract { ...@@ -25,6 +25,8 @@ class CENTROIDAL_DYNAMICS_DLLAPI Solver_LP_qpoases : public Solver_LP_abstract {
public: public:
Solver_LP_qpoases(); Solver_LP_qpoases();
virtual ~Solver_LP_qpoases() {}
/** Solve the linear program /** Solve the linear program
* minimize c' x * minimize c' x
* subject to Alb <= A x <= Aub * subject to Alb <= A x <= Aub
......
...@@ -72,6 +72,10 @@ Equilibrium::Equilibrium(const string& name, const double mass, const unsigned i ...@@ -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); 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, bool Equilibrium::computeGenerators(Cref_matrixX3 contactPoints, Cref_matrixX3 contactNormals,
double frictionCoefficient, const bool perturbate) { double frictionCoefficient, const bool perturbate) {
long int c = contactPoints.rows(); 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