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

Activity memory leak caused by anonymous threads #43

Open
cuixiaoyiyi opened this issue Aug 31, 2022 · 0 comments
Open

Activity memory leak caused by anonymous threads #43

cuixiaoyiyi opened this issue Aug 31, 2022 · 0 comments

Comments

@cuixiaoyiyi
Copy link

Possible Memory Leak

An anonymous inner class will hold a reference to the this pointer of the outer class and will not be released until the thread ends.
It will hold the Activity and prevent its timely release. Please check the links below.

Occurrences

https://github.com/snikket-im/snikket-android/blob/master/src/main/java/eu/siacs/conversations/ui/RecordingActivity.java#L140
https://github.com/snikket-im/snikket-android/blob/master/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java#L320

Possible Solution

If it is necessary, it can be changed to static class + weak reference to eliminate the reference to the activity, which may cause memory leaks.
Further discussion is welcome.

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

No branches or pull requests

1 participant