Add virtual default dtor to base class

TrivialEar has data members and virtual functions, but no virtual destructor.
Two subclasses  (MinimalWeightEar & SelfIntersectionEar) exist, but they do
not add any new data members. So deleting through any pointer should be okay,
but to be sure and silence compiler warnings add the virtual dtor to the base
class.
This ensures all subclasses are theoretically allowed to add new data members
that will get destructed, regardless of the pointer type used for destruction.
This commit is contained in:
Norbert Wenzel 2019-10-20 13:38:39 +02:00
parent 910da4c3e3
commit 30f05d8fc9
1 changed files with 2 additions and 0 deletions

View File

@ -100,6 +100,8 @@ public:
ComputeQuality();
ComputeAngle();
}
// enforce virtual dtor for this class and all subclasses
virtual ~TrivialEar() = default;
/// Compute the angle of the two edges of the ear.
// it tries to make the computation in a precision safe way.