funkwhale-app-android/app
Hugh Daschbach c1eb9d6b2a Fix landscape view induced MainActivity leak.
With landscape view enabled (e.g. e06b2c7) in the app and auto
rotation enabled on the phone, switching between portrait and
landscape orientations leaks instances of MainActivity.  This prevents
garbage collection of not just the MainActivity object, but fragments
and other objects referenced by the Activity.

This is caused by repositories, the AppContext instance, the player
service, and authentication code maintaining a reference to the
context which with they are initialized.  So rather than initialize
these with an Activity context, pass them the Application context.

Activities are torn down and rebuilt on screen rotation.  The
Application context is not.

To enable instantiation of the FavoritedRepository with the
Application context, delay that repository’s initialization until
first use.  This ensures the Application context is fully initialized.
It is not fully initialized until the MainActivity has been fully
initialized.
2023-11-07 08:33:36 +00:00
..
src Fix landscape view induced MainActivity leak. 2023-11-07 08:33:36 +00:00
.gitignore Initial commit. 2019-10-20 15:19:18 +02:00
build.gradle.kts chore(deps): update dependency io.insert-koin:koin-test to v3.5.0 2023-11-06 12:21:47 -08:00
proguard-rules.pro Change base package name from org to audio 2021-07-12 10:14:26 +02:00