Hi, I am using Tesseract 3.0.2, lately I found a memory leak from a very 
basic tesseract recognition steps, I realized I missed a delete [] from 
GetUTF8Text(). 
The problem is when I was trying to delete it, it crashes. May I know what 
is happening here? I am following the sample from tesseract.

Below is a block of sample code.

tesseract::TessBaseAPI *myOCR = new tesseract::TessBaseAPI();   
myOCR->SetPageSegMode(tesseract::PSM_AUTO);

if (myOCR->Init("./", "new+old")) {

std::cerr << "Could not initialize tesseract." << std::endl;
exit(1);
}

 myOCR->SetVariable("tessedit_char_blacklist",
"abcdefghijklmnopqrstuvwxyz`~!@#$%^&*()_+-={}[]|\':;/?.<,>");
myOCR->SetVariable("tessedit_char_whitelist",
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
myOCR->SetImage((uchar*) plate_segments.data,
plate_segments.size().width, plate_segments.size().height,
plate_segments.channels(), plate_segments.step1());

myOCR->Recognize(0);
char* license_result = myOCR->GetUTF8Text();
               
delete [] license_result;  <--- CAUSE CRASH???

-- 
-- 
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to