From 0dd23f5665218644ce5b553842de618f11ffcc45 Mon Sep 17 00:00:00 2001 From: Adam Wushensky Date: Wed, 2 Feb 2022 17:19:21 -0800 Subject: [PATCH 1/2] Track the main loop for cleanup --- .../cardimageverification/CardImageVerificationFlow.kt | 2 +- .../com/stripe/android/stripecardscan/cardscan/CardScanFlow.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationFlow.kt b/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationFlow.kt index 87bc376773f..4e82fc22a80 100644 --- a/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationFlow.kt +++ b/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationFlow.kt @@ -103,7 +103,7 @@ internal abstract class CardImageVerificationFlow( resultHandler = mainLoopOcrAggregator, analyzerLoopErrorListener = scanErrorListener ).apply { - subscribeTo( + mainLoopJob = subscribeTo( imageStream.map { MainLoopAnalyzer.Input( cameraPreviewImage = it, diff --git a/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardscan/CardScanFlow.kt b/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardscan/CardScanFlow.kt index 63ed44eb570..15154cdd476 100644 --- a/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardscan/CardScanFlow.kt +++ b/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardscan/CardScanFlow.kt @@ -78,7 +78,7 @@ internal abstract class CardScanFlow( resultHandler = it, analyzerLoopErrorListener = scanErrorListener ).apply { - subscribeTo( + mainLoopJob = subscribeTo( imageStream.map { SSDOcr.cameraPreviewToInput(it.image, it.viewBounds, viewFinder) }, From d62c1b2f8290d36d048bb26fda0c1b841569a27e Mon Sep 17 00:00:00 2001 From: Adam Wushensky Date: Wed, 2 Feb 2022 17:21:44 -0800 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 773c3ce4abe..050cc88ccd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### PaymentSheet ### Identity ### Card scanning +* [FIXED] [4548](https://github.com/stripe/stripe-android/pull/4548) Potential work leak when canceling a card scan in StripeCardScan ## 19.1.1 - 2022-01-31 ### PaymentSheet