From 30f05d8fc9ae6e1df273b38b98bb2bd8bf7dd901 Mon Sep 17 00:00:00 2001 From: Norbert Wenzel Date: Sun, 20 Oct 2019 13:38:39 +0200 Subject: [PATCH] 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. --- vcg/complex/algorithms/hole.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vcg/complex/algorithms/hole.h b/vcg/complex/algorithms/hole.h index 064d1807..ecb2256b 100644 --- a/vcg/complex/algorithms/hole.h +++ b/vcg/complex/algorithms/hole.h @@ -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.