Activity memory leak caused by anonymous threads

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://gitlab.com/20kdc/offline-puzzle-solver/-/blob/master/app/src/main/java/t20kdc/offlinepuzzlesolver/StreamlineActivity.java#L48

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.

Assignee Loading
Time tracking Loading