Closed SamYStudiO closed 3 years ago
Maybe making these weakreferences may fix the pb? https://github.com/permissions-dispatcher/PermissionsDispatcher/blob/c8876729dfd3cd2158d57098e56e02514792fd62/ktx/src/main/java/permissions/dispatcher/ktx/FragmentExtensions.kt#L28-L31
Thx, I think https://github.com/permissions-dispatcher/PermissionsDispatcher/pull/741 would address the issue.
ktx 1.1.1 has been released.
Overview
Environment
Looking at code source i don't understand how
PermissionsRequester
is cleanup when fragment is destroyed. FromPermissionsRequesterImpl
it looks that a observer is added to an activity viewmodel but it's never removed when fragment is detroyed. https://github.com/permissions-dispatcher/PermissionsDispatcher/blob/c8876729dfd3cd2158d57098e56e02514792fd62/ktx/src/main/java/permissions/dispatcher/ktx/PermissionsRequesterImpl.kt#L20 This has also the side effect ofonNeverAskAgain
to be never called with the last fragment created since only the first leaked fragment is called. https://github.com/permissions-dispatcher/PermissionsDispatcher/blob/c8876729dfd3cd2158d57098e56e02514792fd62/ktx/src/main/java/permissions/dispatcher/ktx/PermissionRequestViewModel.kt#L31Here is the leakcanary log