Skip to content

Commit

Permalink
adding clear method to Tesseract class in order to prevent memory lea…
Browse files Browse the repository at this point in the history
…ks in iOS
  • Loading branch information
mvelikov committed Jun 13, 2013
1 parent 4f93be0 commit a51b2b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Classes/Tesseract.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
- (BOOL)setLanguage:(NSString *)language;
- (BOOL)recognize;
- (NSString *)recognizedText;
- (void)clear;

@end
6 changes: 6 additions & 0 deletions Classes/Tesseract.mm
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ - (NSString *)recognizedText {
return [NSString stringWithUTF8String:utf8Text];
}

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

- (void)setImage:(UIImage *)image
{
free(_pixels);
Expand Down

0 comments on commit a51b2b7

Please sign in to comment.