-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
100% cpu usage after scanning bar code #103
Comments
Hey @klinkert0728. I've just tested the demo app and wasn't able to re-produce it. Do you use the last version of BarcodeScanner? If so, can you point to the line of code in the library that causes this? |
hey @vadymmarkov thanks in advance for the quickly replay. i saved the logs from the profile since i was not able to find the exact line, let me know if that helps |
We found potential reason for this problem and it should be fixed starting from version 4. But yes, it's in Swift 4. |
oh can you point me to the solution i can try to make it work for swift 3? , since for now swift 4 is not an option |
As I remember it was about calling |
|
Try to add this in BarcodeScannerController: deinit {
captureSession.stopRunning()
NotificationCenter.default.removeObserver(self)
} |
i did this, but did not work.
|
Ok, try to call |
did not work |
Ok, running out of ideas here, but try to remove these three lines: if whenProcessing {
self.status = Status(state: .processing)
} from https://github.com/hyperoslo/BarcodeScanner/blob/2.1.2/Sources/BarcodeScannerController.swift#L387 |
it works. thank you very much for your help man. i really appreciate it |
Hey guys, |
You don't really need that animation when you dismiss controller, do you? |
@vadymmarkov The animation that appears is product search and / or product not found. |
Hey i was using your library (btw is awesome), and i found an issue with the cpu usage just after i scan a barcode. Running the time profile i was able to found that the issue is in the barcode.
The text was updated successfully, but these errors were encountered: