I am using tesseract OCR for business card reading.
I have a memory leak and I can’t resolve it, I don’t know how to.
In my code…
tesseract->Recognize(NULL);
char* utf8Text = tesseract->GetUTF8Text();
GetUTF8Text() method gives memory leak.
Here is the log in memory leak instruments:
tesseract::TessBaseAPI::GetUTF8Text()
operator new[](unsigned long) libstdc++.6.dylib
operator new(unsigned long) libstdc++.6.dylib
malloc libsystem_c.dylib
After some memory leaks, app crashes.
GetUTF8Text is in baseapi.h file. I think tessearact was written by c++. I don’t know c++.
Can anyone help? Or anyone has clean tesseract?
According the documentation I found in baseapi.h.
So you will need to
delete []theutf8textwhen you are done with it.