diff --git a/src/ccutil/indexmapbidi.cpp b/src/ccutil/indexmapbidi.cpp index df95a97874..e97ef49d56 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 9a773729c7..6d62fd4a27 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