diff --git a/src/ccutil/ccutil.cpp b/src/ccutil/ccutil.cpp index e33bda47be..32e82c75ed 100644 --- a/src/ccutil/ccutil.cpp +++ b/src/ccutil/ccutil.cpp @@ -27,6 +27,11 @@ CCUtil::CCUtil() : " whether to adapt to a character", ¶ms_) { } +// 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); diff --git a/src/ccutil/ccutil.h b/src/ccutil/ccutil.h index fd1b9f83d6..0cf35ff738 100644 --- a/src/ccutil/ccutil.h +++ b/src/ccutil/ccutil.h @@ -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.