Skip to content

Commit 9c0fd44

Browse files
authored
Merge pull request PointCloudLibrary#5456 from SunBlack/fix_missing_virtual_destructors
Fix missing virtual destructors
2 parents 3967d9d + 8739a5c commit 9c0fd44

File tree

14 files changed

+49
-7
lines changed

14 files changed

+49
-7
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ if(CMAKE_COMPILER_IS_MSVC)
143143
add_definitions("-DBOOST_ALL_NO_LIB -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DNOMINMAX -DPCL_ONLY_CORE_POINT_TYPES ${SSE_DEFINITIONS}")
144144

145145
if("${CMAKE_CXX_FLAGS}" STREQUAL "${CMAKE_CXX_FLAGS_DEFAULT}")
146-
string(APPEND CMAKE_CXX_FLAGS " /fp:precise /wd4800 /wd4521 /wd4251 /wd4275 /wd4305 /wd4355 ${SSE_FLAGS} ${AVX_FLAGS} /bigobj")
146+
string(APPEND CMAKE_CXX_FLAGS " /fp:precise ${SSE_FLAGS} ${AVX_FLAGS} /bigobj")
147147

148148
# Add extra code generation/link optimizations
149149
if(CMAKE_MSVC_CODE_LINK_OPTIMIZATION AND (NOT BUILD_CUDA) AND (NOT BUILD_GPU))
@@ -157,6 +157,12 @@ if(CMAKE_COMPILER_IS_MSVC)
157157
endif()
158158
# /MANIFEST:NO") # please, don't disable manifest generation, otherwise crash at start for vs2008
159159

160+
# Disable some warnings
161+
string(APPEND CMAKE_CXX_FLAGS " /wd4800 /wd4521 /wd4251 /wd4275 /wd4305 /wd4355")
162+
163+
# Enable warnings, which are disabled by default (see https://learn.microsoft.com/de-de/cpp/preprocessor/compiler-warnings-that-are-off-by-default)
164+
string(APPEND CMAKE_CXX_FLAGS " /w34265")
165+
160166
if(PCL_WARNINGS_ARE_ERRORS)
161167
# MSVC supports external includes only since Visual Studio 2019 version 16.10.0.
162168
# CMake supports external includes since 3.22.0 using the Ninja generator or NMake files (see https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4766)

apps/3d_rec_framework/include/pcl/apps/3d_rec_framework/pipeline/global_nn_classifier.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class PCL_EXPORTS GlobalClassifier {
2020
public:
2121
using PointInTPtr = typename pcl::PointCloud<PointInT>::Ptr;
2222

23+
virtual ~GlobalClassifier() = default;
24+
2325
virtual void
2426
setNN(int nn) = 0;
2527

@@ -131,8 +133,6 @@ class PCL_EXPORTS GlobalNNPipeline
131133
public:
132134
GlobalNNPipeline() { NN_ = 1; }
133135

134-
~GlobalNNPipeline() = default;
135-
136136
void
137137
setNN(int nn) override
138138
{

features/include/pcl/features/feature.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,10 @@ namespace pcl
446446
/** \brief Empty constructor. */
447447
FeatureWithLocalReferenceFrames () : frames_ (), frames_never_defined_ (true) {}
448448

449+
/** \brief Default virtual destructor. */
450+
virtual
451+
~FeatureWithLocalReferenceFrames() = default;
452+
449453
/** \brief Provide a pointer to the input dataset that contains the local
450454
* reference frames of the XYZ dataset.
451455
* In case of search surface is set to be different from the input cloud,

gpu/segmentation/include/pcl/gpu/segmentation/gpu_extract_clusters.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ class EuclideanClusterExtraction {
8181
/** \brief Empty constructor. */
8282
EuclideanClusterExtraction() = default;
8383

84+
/** \brief Default virtual destructor. */
85+
virtual ~EuclideanClusterExtraction() = default;
86+
8487
/** \brief the destructor */
8588
/* ~EuclideanClusterExtraction ()
8689
{

gpu/segmentation/include/pcl/gpu/segmentation/gpu_extract_labeled_clusters.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ class EuclideanLabeledClusterExtraction {
8282
/** \brief Empty constructor. */
8383
EuclideanLabeledClusterExtraction() = default;
8484

85+
/** \brief Default virtual destructor. */
86+
virtual ~EuclideanLabeledClusterExtraction() = default;
87+
8588
/** \brief Provide a pointer to the search object.
8689
* \param tree a pointer to the spatial search object.
8790
*/

ml/include/pcl/ml/dt/decision_tree_data_provider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class PCL_EXPORTS DecisionTreeTrainerDataProvider {
7070
DecisionTreeTrainerDataProvider() = default;
7171

7272
/** Destructor. */
73-
~DecisionTreeTrainerDataProvider() = default;
73+
virtual ~DecisionTreeTrainerDataProvider() = default;
7474

7575
/** Virtual function called to obtain training examples and labels before
7676
* training a specific tree */

recognition/include/pcl/recognition/face_detection/face_detector_data_provider.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ namespace pcl
122122
min_images_per_bin_ = -1;
123123
}
124124

125-
virtual ~FaceDetectorDataProvider() = default;
126-
127125
void setPatchesPerImage(int n)
128126
{
129127
patches_per_image_ = n;

surface/include/pcl/surface/3rdparty/poisson4/bspline_data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ namespace pcl
7272
BSplineComponents* baseBSplines;
7373

7474
BSplineData();
75-
~BSplineData();
75+
virtual ~BSplineData();
7676

7777
virtual void setDotTables( int flags );
7878
virtual void clearDotTables( int flags );

surface/include/pcl/surface/3rdparty/poisson4/geometry.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ namespace pcl
200200
{
201201
public:
202202
std::vector<Point3D<float> > inCorePoints;
203+
204+
virtual ~CoredMeshData() = default;
203205
virtual void resetIterator( void ) = 0;
204206

205207
virtual int addOutOfCorePoint( const Point3D<float>& p ) = 0;
@@ -231,6 +233,9 @@ namespace pcl
231233
value = ( p1[0] * p2[0] + p1[1] * p2[1] + p1[2] * p2[2] ) / ( p2[0] * p2[0] + p2[1] * p2[1] + p2[2] * p2[2] );
232234
}
233235
};
236+
237+
virtual ~CoredMeshData2() = default;
238+
234239
std::vector< Vertex > inCorePoints;
235240
virtual void resetIterator( void ) = 0;
236241

surface/include/pcl/surface/on_nurbs/fitting_curve_2d.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ namespace pcl
9393
*/
9494
FittingCurve2d (NurbsDataCurve2d *data, const ON_NurbsCurve &nc);
9595

96+
/** \brief Default virtual destructor. */
97+
virtual
98+
~FittingCurve2d() = default;
99+
96100
/** \brief Find the element in which the parameter xi lies.
97101
* \param[in] xi value in parameter domain of the B-Spline curve.
98102
* \param[in] elements the vector of elements of the curve.

0 commit comments

Comments
 (0)