Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent AddSourceActivity's SourceCallback from being GCed #791

Merged
merged 1 commit into from
Jan 30, 2019

Conversation

mshafrir-stripe
Copy link
Collaborator

Summary
Stripe#CreateSourceTask holds a WeakReference to the
SourceCallback. In some cases, this reference was being
garbage collected, causing callback (either onSuccess() or
onError()) to never happen.

Making the SourceCallback an instance variable seems to fix
this issue.

Motivation
Because the callback was never happening, the user would be
stuck on the "Add a Card" screen.

screenshot_1548884709

Testing
Tested manually on various API levels.

**Summary**
`Stripe#CreateSourceTask` holds a `WeakReference` to the
`SourceCallback`. This reference was being garbage collected,
causing callback (either onSuccess or onError) to never happen.

Making the SourceCallback an instance variable seems to fix
this issue.

**Motivation**
Because the callback was never happening, the user would be
stuck on the "Add a Card" screen.

**Testing**
Tested manually on various API levels.
@mshafrir-stripe mshafrir-stripe merged commit 2b74328 into master Jan 30, 2019
@mshafrir-stripe mshafrir-stripe deleted the sourcecallback branch January 30, 2019 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants