Skip to content

Commit

Permalink
Cardinal Cleanup Method (#926)
Browse files Browse the repository at this point in the history
* Call Cardinal cleanup method to resolve memory leak from Cardinal.getInstance
* Verified via Leak Canary that the getInstance memory leak is gone
  • Loading branch information
jaxdesmarais authored Feb 21, 2024
1 parent 19f6b3e commit 8cc2855
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* Venmo
* Add `setIsFinalAmount()` to `VenmoRequest`
* ThreeDSecure
* Call cleanup method to resolve `Cardinal.getInstance` memory leak

## 4.41.0 (2024-01-18)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ void continueLookup(ThreeDSecureResult threeDSecureResult, CardinalChallengeObse
} catch (RuntimeException e) {
throw new BraintreeException("Cardinal SDK cca_continue Error.", e);
}

Cardinal.getInstance().cleanup();
}

private void configureCardinal(Context context, Configuration configuration, ThreeDSecureRequest request) throws BraintreeException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ class CardinalClientUnitTest {
cardinalChallengeObserver
)
}

verify { cardinalInstance.cleanup() }
}

@Test
Expand Down

0 comments on commit 8cc2855

Please sign in to comment.