Closed bertsky closed 3 years ago
The segfault is caused by a bug in Tesseract (see discussion. This PR is not needed (and also does not fix the bug, only works around it for one use case).
Ah, good to know. Did not see this.
But still – since we are on it: is End()
really the correct thing to do if Init()
resulted in a failure?
Maybe it's not necessary (or even not necessary at all in tesserocr as it is called in the destructor anyway), but it should be allowed to call it without causing any harm.
This fixes a segfault when the Tesseract installation has no
eng.traineddata
or no tessdata dir, and no API object (besides the automatic module-level one) was instantiated before exit.To reproduce the segfault:
(See here for further diagnosis.)