Navaron Bracke

call close on the barcode scanning client

@@ -472,4 +472,11 @@ class MobileScanner( @@ -472,4 +472,11 @@ class MobileScanner(
472 camera?.cameraControl?.setZoomRatio(1f) 472 camera?.cameraControl?.setZoomRatio(1f)
473 } 473 }
474 474
  475 + /**
  476 + * Dispose of this scanner instance.
  477 + */
  478 + fun dispose() {
  479 + scanner?.close()
  480 + scanner = null
  481 + }
475 } 482 }
@@ -92,6 +92,7 @@ class MobileScannerHandler( @@ -92,6 +92,7 @@ class MobileScannerHandler(
92 fun dispose(activityPluginBinding: ActivityPluginBinding) { 92 fun dispose(activityPluginBinding: ActivityPluginBinding) {
93 methodChannel?.setMethodCallHandler(null) 93 methodChannel?.setMethodCallHandler(null)
94 methodChannel = null 94 methodChannel = null
  95 + mobileScanner?.dispose()
95 mobileScanner = null 96 mobileScanner = null
96 97
97 val listener: RequestPermissionsResultListener? = permissions.getPermissionListener() 98 val listener: RequestPermissionsResultListener? = permissions.getPermissionListener()