Skip to content

Commit 4fa2a34

Browse files
committed
EquationDetectBase: Define virtual destructor in .cpp file
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>
1 parent f29a949 commit 4fa2a34

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/textord/equationdetectbase.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323

2424
namespace tesseract {
2525

26+
// Destructor.
27+
// It is defined here, so the compiler can create a single vtable
28+
// instead of weak vtables in every compilation unit.
29+
EquationDetectBase::~EquationDetectBase() = default;
30+
2631
void EquationDetectBase::RenderSpecialText(Pix* pix,
2732
BLOBNBOX* blob) {
2833
ASSERT_HOST(pix != nullptr && pixGetDepth(pix) == 32 && blob != nullptr);

src/textord/equationdetectbase.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ColPartitionSet;
3232
class EquationDetectBase {
3333
public:
3434
EquationDetectBase() = default;
35-
virtual ~EquationDetectBase() = default;
35+
virtual ~EquationDetectBase();
3636

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

0 commit comments

Comments
 (0)