Bring back escaped virtual destructors from 2.4.2

pull/51/head
Andrey Kamaev 12 years ago
parent 3ffe0f0117
commit a3b1971977
  1. 8
      cmake/OpenCVCompilerOptions.cmake
  2. 8
      modules/core/include/opencv2/core/core.hpp
  3. 4
      modules/core/src/matrix.cpp
  4. 3
      modules/flann/include/opencv2/flann/any.h
  5. 2
      modules/videostab/include/opencv2/videostab/motion_stabilizing.hpp

@ -56,12 +56,18 @@ if(MINGW)
endif()
endif()
if(OPENCV_CAN_BREAK_BINARY_COMPATIBILITY)
add_definitions(-DOPENCV_CAN_BREAK_BINARY_COMPATIBILITY)
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
# High level of warnings.
add_extra_compiler_option(-W)
add_extra_compiler_option(-Wall)
add_extra_compiler_option(-Werror=return-type)
#add_extra_compiler_option(-Werror=non-virtual-dtor)
if(OPENCV_CAN_BREAK_BINARY_COMPATIBILITY)
add_extra_compiler_option(-Werror=non-virtual-dtor)
endif()
add_extra_compiler_option(-Werror=address)
add_extra_compiler_option(-Werror=sequence-point)
add_extra_compiler_option(-Wformat)

@ -1345,7 +1345,9 @@ public:
virtual int channels(int i=-1) const;
virtual bool empty() const;
/*virtual*/ ~_InputArray();
#ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
virtual ~_InputArray();
#endif
int flags;
void* obj;
@ -1407,7 +1409,9 @@ public:
virtual void release() const;
virtual void clear() const;
/*virtual*/ ~_OutputArray();
#ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
virtual ~_OutputArray();
#endif
};
typedef const _InputArray& InputArray;

@ -917,7 +917,9 @@ void scalarToRawData(const Scalar& s, void* _buf, int type, int unroll_to)
\*************************************************************************************************/
_InputArray::_InputArray() : flags(0), obj(0) {}
#ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
_InputArray::~_InputArray() {}
#endif
_InputArray::_InputArray(const Mat& m) : flags(MAT), obj((void*)&m) {}
_InputArray::_InputArray(const vector<Mat>& vec) : flags(STD_VECTOR_MAT), obj((void*)&vec) {}
_InputArray::_InputArray(const double& val) : flags(FIXED_TYPE + FIXED_SIZE + MATX + CV_64F), obj((void*)&val), sz(Size(1,1)) {}
@ -1281,7 +1283,9 @@ bool _InputArray::empty() const
_OutputArray::_OutputArray() {}
#ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
_OutputArray::~_OutputArray() {}
#endif
_OutputArray::_OutputArray(Mat& m) : _InputArray(m) {}
_OutputArray::_OutputArray(vector<Mat>& vec) : _InputArray(vec) {}
_OutputArray::_OutputArray(gpu::GpuMat& d_mat) : _InputArray(d_mat) {}

@ -47,7 +47,10 @@ struct base_any_policy
virtual ::size_t get_size() = 0;
virtual const std::type_info& type() = 0;
virtual void print(std::ostream& out, void* const* src) = 0;
#ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
virtual ~base_any_policy() {}
#endif
};
template<typename T>

@ -56,7 +56,9 @@ namespace videostab
class CV_EXPORTS IMotionStabilizer
{
public:
#ifdef OPENCV_CAN_BREAK_BINARY_COMPATIBILITY
virtual ~IMotionStabilizer() {}
#endif
// assumes that [0, size-1) is in or equals to [range.first, range.second)
virtual void stabilize(

Loading…
Cancel
Save