evermeer / PassportScanner

Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.
BSD 3-Clause "New" or "Revised" License
457 stars 101 forks source link

Possible memory leak or normal behavior #35

Closed babucha closed 5 years ago

babucha commented 5 years ago

I've just noticed that after each scan the memory allocated is getting 8-10Mb bigger (after about 10 scans memory usage exceeds 100 Mb ). Is it OK, or maybe an issue of Debug Navigator? It seems that when the PassportScannerController dismisses, it has not been fully deallocated. Tesseract cash clean up doesn't help.

babucha commented 5 years ago

Probably, I've found a solution (taken the problem really exists) - added a check if the var tesseract has already been assigned to @objc public func setup(). Now memory usage remains stable even after a multiple consecutive scans

evermeer commented 5 years ago

Sounds good. Could you make a Pull Request for that?

evermeer commented 5 years ago

The change is published as version 4.6.0