Skip to content

Commit 39ec5a8

Browse files
committed
let the dispose method delegate to stop() on Android
1 parent ee336cd commit 39ec5a8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScanner.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,10 @@ class MobileScanner(
512512
* Dispose of this scanner instance.
513513
*/
514514
fun dispose() {
515-
scanner?.close()
516-
scanner = null
515+
if (isStopped()) {
516+
return
517+
}
518+
519+
stop() // Defer to the stop method, which disposes all resources anyway.
517520
}
518521
}

0 commit comments

Comments
 (0)