Skip to content

Commit

Permalink
Add pool for background thread to stop leaking.
Browse files Browse the repository at this point in the history
  • Loading branch information
niw committed Apr 17, 2011
1 parent aa85de5 commit dc44534
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Classes/OpenCVTestViewController.m
Expand Up @@ -79,6 +79,8 @@ - (void)hideProgressIndicator {
}

- (void)opencvEdgeDetect {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

if(imageView.image) {
cvSetErrMode(CV_ErrModeParent);

Expand Down Expand Up @@ -107,9 +109,13 @@ - (void)opencvEdgeDetect {

[self hideProgressIndicator];
}

[pool release];
}

- (void) opencvFaceDetect:(UIImage *)overlayImage {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

if(imageView.image) {
cvSetErrMode(CV_ErrModeParent);

Expand Down Expand Up @@ -166,6 +172,8 @@ - (void) opencvFaceDetect:(UIImage *)overlayImage {

[self hideProgressIndicator];
}

[pool release];
}


Expand Down

0 comments on commit dc44534

Please sign in to comment.