diff --git a/src/dict/dawg.cpp b/src/dict/dawg.cpp index db626a4a4b..864e60c866 100644 --- a/src/dict/dawg.cpp +++ b/src/dict/dawg.cpp @@ -42,6 +42,11 @@ ----------------------------------------------------------------------*/ namespace tesseract { +// Destructor. +// It is defined here, so the compiler can create a single vtable +// instead of weak vtables in every compilation unit. +Dawg::~Dawg() = default; + bool Dawg::prefix_in_dawg(const WERD_CHOICE &word, bool requires_complete) const { if (word.length() == 0) return !requires_complete; diff --git a/src/dict/dawg.h b/src/dict/dawg.h index 9c4c09d231..0d3c2f619a 100644 --- a/src/dict/dawg.h +++ b/src/dict/dawg.h @@ -129,7 +129,7 @@ class Dawg { inline const STRING &lang() const { return lang_; } inline PermuterType permuter() const { return perm_; } - virtual ~Dawg() = default; + virtual ~Dawg(); /// Returns true if the given word is in the Dawg. bool word_in_dawg(const WERD_CHOICE &word) const;