Skip to content

Commit

Permalink
EquationDetectBase: Define virtual destructor in .cpp file
Browse files Browse the repository at this point in the history
This fixes compiler warnings from clang:

src/textord/equationdetectbase.h:32:7: warning:
 'EquationDetectBase' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Sep 4, 2018
1 parent f29a949 commit 4fa2a34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/textord/equationdetectbase.cpp
Expand Up @@ -23,6 +23,11 @@

namespace tesseract {

// Destructor.
// It is defined here, so the compiler can create a single vtable
// instead of weak vtables in every compilation unit.
EquationDetectBase::~EquationDetectBase() = default;

void EquationDetectBase::RenderSpecialText(Pix* pix,
BLOBNBOX* blob) {
ASSERT_HOST(pix != nullptr && pixGetDepth(pix) == 32 && blob != nullptr);
Expand Down
2 changes: 1 addition & 1 deletion src/textord/equationdetectbase.h
Expand Up @@ -32,7 +32,7 @@ class ColPartitionSet;
class EquationDetectBase {
public:
EquationDetectBase() = default;
virtual ~EquationDetectBase() = default;
virtual ~EquationDetectBase();

// Iterate over the blobs inside to_block, and set the blobs that we want to
// process to BSTT_NONE. (By default, they should be BSTT_SKIP). The function
Expand Down

0 comments on commit 4fa2a34

Please sign in to comment.