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

Guards Against Context Memory Leaking #396

Merged
merged 2 commits into from
Oct 7, 2020
Merged

Guards Against Context Memory Leaking #396

merged 2 commits into from
Oct 7, 2020

Conversation

bitmold
Copy link
Collaborator

@bitmold bitmold commented Sep 24, 2020

Used static inner classes for AsyncTasks in OrbotMainActivity, BridgeWizardActivity and AppManagerActivity. Removes massive warnings from code. Basically anonymous AsyncTask implementations (such as Handler) implicitly hold a reference to the outer Activity, this could cause a memory leak where the AsyncTask is still running after the Activity has terminated preventing the latter from being properly garbage collected.

https://www.androiddesignpatterns.com/2013/01/inner-class-handler-memory-leak.html

@bitmold bitmold changed the title Guards Against Leaking a Context Guards Against Context Memory Leaking Sep 24, 2020
@bitmold bitmold requested a review from n8fr8 September 24, 2020 04:23
…WizardActivity

+ AppManagerActivity. Removes huge warnings from code. Anonymous AsyncTask
implementations (such as Handler) implicitly hold a reference to the outer
Activity, this could cause a memory leak where the AsyncTask is still running
after the Activity has terminated
@n8fr8 n8fr8 merged commit 1cbcd4f into guardianproject:master Oct 7, 2020
@bitmold bitmold deleted the leaky_async_tasks branch October 8, 2020 03:18
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.

None yet

2 participants