We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f37f858 commit 7814259Copy full SHA for 7814259
api/tesseractmain.cpp
@@ -27,6 +27,7 @@
27
#include "allheaders.h"
28
#include "baseapi.h"
29
#include "basedir.h"
30
+#include "dict.h"
31
#include "openclwrapper.h"
32
#include "osdetect.h"
33
#include "renderer.h"
@@ -425,6 +426,11 @@ int main(int argc, char** argv) {
425
426
427
PERF_COUNT_START("Tesseract:main")
428
429
+ // Call GlobalDawgCache here to create the global DawgCache object before
430
+ // the TessBaseAPI object. This fixes the order of destructor calls:
431
+ // first TessBaseAPI must be destructed, DawgCache must be the last object.
432
+ tesseract::Dict::GlobalDawgCache();
433
+
434
// Avoid memory leak caused by auto variable when exit() is called.
435
static tesseract::TessBaseAPI api;
436
0 commit comments