diff --git a/src/ccstruct/ccstruct.cpp b/src/ccstruct/ccstruct.cpp index 151df33e1e..4d188c4137 100644 --- a/src/ccstruct/ccstruct.cpp +++ b/src/ccstruct/ccstruct.cpp @@ -28,4 +28,9 @@ const double CCStruct::kAscenderFraction = 0.25; const double CCStruct::kXHeightCapRatio = CCStruct::kXHeightFraction / (CCStruct::kXHeightFraction + CCStruct::kAscenderFraction); +// Destructor. +// It is defined here, so the compiler can create a single vtable +// instead of weak vtables in every compilation unit. +CCStruct::~CCStruct() = default; + } diff --git a/src/ccstruct/ccstruct.h b/src/ccstruct/ccstruct.h index dfdf77bfe2..8979ea33ff 100644 --- a/src/ccstruct/ccstruct.h +++ b/src/ccstruct/ccstruct.h @@ -25,7 +25,7 @@ namespace tesseract { class CCStruct : public CUtil { public: CCStruct() = default; - ~CCStruct() = default; + virtual ~CCStruct(); // Globally accessible constants. // APPROXIMATIONS of the fractions of the character cell taken by