Skip to content

Commit 309c962

Browse files
author
Pascal Thomet
committed
core/bufferpool.hpp: let msvc accept a non virtual protected destructor
BufferPoolController has a non virtual protected destructor (which is legitimate) However, Visual Studio sees this as a bug, if you enable more warnings, like below ``` add_compile_options(/W3) # level 3 warnings add_compile_options(/we4265) # warning about missing virtual destructors ``` This is a proposition in order to silence this warning. See https://github.com/ivsgroup/boost_warnings_minimal_demo for a demo of the same problem with boost/exception.hpp
1 parent cddf868 commit 309c962

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/core/include/opencv2/core/bufferpool.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
#ifndef OPENCV_CORE_BUFFER_POOL_HPP
88
#define OPENCV_CORE_BUFFER_POOL_HPP
99

10+
#ifdef _MSC_VER
11+
#pragma warning(push)
12+
#pragma warning(disable: 4265)
13+
#endif
14+
1015
namespace cv
1116
{
1217

@@ -28,4 +33,8 @@ class BufferPoolController
2833

2934
}
3035

36+
#ifdef _MSC_VER
37+
#pragma warning(pop)
38+
#endif
39+
3140
#endif // OPENCV_CORE_BUFFER_POOL_HPP

0 commit comments

Comments
 (0)