czlucius / code-scanner

An Android app to scan and generate codes(barcodes/QR codes)
GNU Affero General Public License v3.0
39 stars 24 forks source link

Camera may not shut down if no codes are scanned #18

Closed czlucius closed 2 years ago

czlucius commented 2 years ago

https://github.com/czlucius/code-scanner/blob/2b487c2868267cd06f98f46dcb942facaaf5df79/app/src/main/java/com/czlucius/scan/ui/ScannerFragment.java#L223

As seen, the method onDestroyView returns when no codes are found. Hence, the camera may not close properly if no codes are scanned.

czlucius commented 2 years ago

Closing this issue. The value is initialised at start of the View Model, hence the camera would not be open even codes is null.