Skip to content

Commit

Permalink
Merge pull request ldiqual#17 from frank4565/master
Browse files Browse the repository at this point in the history
Fixed two memory leaks.
  • Loading branch information
ldiqual committed Jan 26, 2014
2 parents c6aeaff + f00f8e6 commit 162e6ee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Tesseract.mm
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,17 @@ - (BOOL)recognize {

- (NSString *)recognizedText {
char* utf8Text = _tesseract->GetUTF8Text();
return [NSString stringWithUTF8String:utf8Text];
NSString *text = [NSString stringWithUTF8String:utf8Text];
delete[] utf8Text;
return text;
}

- (void)clear
{
free(_pixels);
_tesseract->Clear();
_tesseract->End();
delete _tesseract;
}

- (void)setImage:(UIImage *)image
Expand Down

0 comments on commit 162e6ee

Please sign in to comment.