Skip to content

Commit

Permalink
Merge pull request #458 from dartsim/virtual_destructor
Browse files Browse the repository at this point in the history
Add virtual destructors to Properties in Entity and [Soft]BodyNode
  • Loading branch information
jslee02 committed Jul 19, 2015
2 parents 04af96b + ab896b4 commit 009d44a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dart/dynamics/BodyNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ class BodyNode : public Frame, public SkeletonRefCountingBase
double _restitutionCoeff = DART_DEFAULT_RESTITUTION_COEFF,
bool _gravityMode = true);

virtual ~UniqueProperties() = default;

// To get byte-aligned Eigen vectors
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
Expand All @@ -135,6 +137,8 @@ class BodyNode : public Frame, public SkeletonRefCountingBase
Properties(
const Entity::Properties& _entityProperties = Entity::Properties("BodyNode"),
const UniqueProperties& _bodyNodeProperties = UniqueProperties());

virtual ~Properties() = default;
};

/// Destructor
Expand Down
2 changes: 2 additions & 0 deletions dart/dynamics/Entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ class Entity : public virtual common::Subject
/// Constructor
Properties(const std::string& _name = "",
const std::vector<ShapePtr>& _vizShapes=std::vector<ShapePtr>());

virtual ~Properties() = default;
};

/// Constructor for typical usage
Expand Down
4 changes: 4 additions & 0 deletions dart/dynamics/SoftBodyNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ class SoftBodyNode : public BodyNode
const std::vector<Eigen::Vector3i>& _faces =
std::vector<Eigen::Vector3i>());

virtual ~UniqueProperties() = default;

/// Add a PointMass to this Properties struct
void addPointMass(const PointMass::Properties& _properties);

Expand All @@ -112,6 +114,8 @@ class SoftBodyNode : public BodyNode
const BodyNode::Properties& _bodyProperties = BodyNode::Properties(),
const SoftBodyNode::UniqueProperties& _softProperties =
SoftBodyNode::UniqueProperties());

virtual ~Properties() = default;
};

/// \brief
Expand Down

0 comments on commit 009d44a

Please sign in to comment.