CCUtil: Define virtual destructor in .cpp file

This fixes compiler warnings from clang:

src/ccutil/ccutil.h:51:7: warning:
 'CCUtil' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-09-04 07:44:27 +02:00
parent 14c23c9f13
commit 5b8162f0ef
2 changed files with 6 additions and 1 deletions

View File

@ -27,6 +27,11 @@ CCUtil::CCUtil() :
" whether to adapt to a character", &params_) {
}
// Destructor.
// It is defined here, so the compiler can create a single vtable
// instead of weak vtables in every compilation unit.
CCUtil::~CCUtil() = default;
CCUtilMutex::CCUtilMutex() {
#ifdef _WIN32
mutex_ = CreateMutex(0, FALSE, 0);

View File

@ -51,7 +51,7 @@ class CCUtilMutex {
class CCUtil {
public:
CCUtil();
virtual ~CCUtil() = default;
virtual ~CCUtil();
public:
// Read the arguments and set up the data path.