ios - Exception when reusing CIDetector -


while attempting reduce computation time while detection faces using cidetector tried reuse single detector instance multiple face detections, recommended apple:

this class can maintain many state variables can impact performance. best performance, reuse cidetector instances instead of creating new ones.

all worked fine until began processing thousands of photos. now, time time random exception exc_bad_access. doesn't happen when don't reuse detector instantiate new 1 every time.

some relevant code snippets:

@property (retain, nonatomic) cidetector* facedetector;  - (void)initialvals {     nsdictionary *opts_context = @{kcicontextusesoftwarerenderer: @no};     self.context = [cicontext contextwithoptions:opts_context];     nsdictionary *opts = @{ cidetectoraccuracy: cidetectoraccuracyhigh,                         cidetectortracking: @yes,                         cidetectorminfeaturesize: @0.15                       }; self.facedetector = [cidetector detectoroftype:cidetectortypeface context:self.context options:opts]; 

}

i'm not sure question may related cidetector isn't releasing memory .

problem solved, @ least partially removing flag cidetectortracking: @yes when creating detector.

it eliminates crash while compromising on functionality. filed official bug report.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -