googlesamples / googlesamples/mlkit
using Google MLKit Barcode scanning memory leak
- Dominant language
- Kotlin
- Stars
- 4.3k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
I used the following code:
private var zoomCallback = ZoomSuggestionOptions.ZoomCallback { zoomLevel: Float ->
camera!!.cameraControl.setZoomRatio(zoomLevel)
true
}
private var barcodeScanner = BarcodeScanning.getClient(
BarcodeScannerOptions.Builder()
.setBarcodeFormats(Barcode.FORMAT_QR_CODE)
.setZoomSuggestionOptions(ZoomSuggestionOptions.Builder(zoomCallback).build())
.build()
)
override fun onDestroy() {
super.onDestroy()
barcodeScanner.close()
}
Always in GC when service is destroyed
I tried removing "camera!!.cameraControl.setZoomRatio(zoomLevel)"
Fixed memory leak
What is the reason?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.