Skip to content

Commit

Permalink
Added pixDestroy() call to Tesseract dealloc() function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Conley committed Nov 13, 2014
1 parent bc461c8 commit 49ec849
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Binary file modified Products/TesseractOCR.framework/Versions/A/TesseractOCR
Binary file not shown.
6 changes: 4 additions & 2 deletions TesseractOCR/Tesseract.mm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ - (id)initWithLanguage:(NSString*)language {

self = [self initPrivateWithDataPath:nil language:language];
if (self) {
currentPix = NULL;
}
return self;
}
Expand All @@ -72,6 +71,9 @@ - (void)dealloc {
delete _tesseract;
_tesseract = nullptr;
}
if (currentPix != nullptr) {
pixDestroy(&currentPix);
}
}

- (id)initWithDataPath:(NSString *)dataPath language:(NSString *)language {
Expand Down Expand Up @@ -218,7 +220,7 @@ - (void)setImage:(UIImage *)image {
assert(bytesPerRow < MAX_INT32);
{
imageThresholder->SetImage(_pixels,width,height,(int)(bitsPerPixel/bitsPerComponent),(int)bytesPerRow);
if (currentPix != NULL) {
if (currentPix != nullptr) {
pixDestroy(&currentPix);
}
currentPix = imageThresholder->GetPixRect();
Expand Down

0 comments on commit 49ec849

Please sign in to comment.