diff --git a/src/ccutil/indexmapbidi.cpp b/src/ccutil/indexmapbidi.cpp index df95a978..e97ef49d 100644 --- a/src/ccutil/indexmapbidi.cpp +++ b/src/ccutil/indexmapbidi.cpp @@ -21,6 +21,11 @@ namespace tesseract { +// Destructor. +// It is defined here, so the compiler can create a single vtable +// instead of weak vtables in every compilation unit. +IndexMap::~IndexMap() = default; + // SparseToCompact takes a sparse index to an index in the compact space. // Uses a binary search to find the result. For faster speed use // IndexMapBiDi, but that takes more memory. diff --git a/src/ccutil/indexmapbidi.h b/src/ccutil/indexmapbidi.h index 9a773729..6d62fd4a 100644 --- a/src/ccutil/indexmapbidi.h +++ b/src/ccutil/indexmapbidi.h @@ -41,7 +41,7 @@ class IndexMapBiDi; // It must be initialized by copying from an IndexMapBiDi or by DeSerialize. class IndexMap { public: - virtual ~IndexMap() = default; + virtual ~IndexMap(); // SparseToCompact takes a sparse index to an index in the compact space. // Uses a binary search to find the result. For faster speed use