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

Refactor: avoid using global activity reference #350

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

thgoebel
Copy link
Contributor

It is a memory leak to store the activity reference. It can also cause crashes (e.g., when the service continues running in the background but the activity is already killed).

It is better to use a local context.

This PR is a first step. In a subsequent future PR I will fully remove AppContext.getActivity().

It is a memory leak to store the activity reference.
It can also cause crashes (e.g., when the service continues running in the
background but the activity is already killed).

It is better to use a local context.
@simondankelmann simondankelmann merged commit 5b25258 into simondankelmann:main Jan 30, 2025
1 check passed
@thgoebel thgoebel deleted the use-local-activity branch January 30, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants