Showing
2 changed files
with
8 additions
and
0 deletions
| @@ -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() |
-
Please register or login to post a comment