Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
actually i think it is also broken when we skip some generations due to multiple invalidations.
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit b8ed9da43f816d4ea8c0f19330b280b2a47cfd3b
Author: Dustin Lam <dustinlam@google.com>
Date: Wed Jan 06 16:14:16 2021
Prevent PageFetcher from leaking InvalidateCallbacks
In cases where PagingSource invalidates itself before a new generation
can be kicked off, PageFetcher has a fast-path which immediately creates
a new PagingSource but during this process leaks a listener.
Relnote: "Fixed a rare memory leak which happens when a PagingSource is
invalidated before PageFetcher can even begin to start loading from it."
Fixes: 174625633
Test: ./gradlew paging:paging-common:test
Change-Id: I9606bc3c393a40d732bf633b721b13b23c46db02
M paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt
M paging/common/src/main/kotlin/androidx/paging/PagingSource.kt
M paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
https://android-review.googlesource.com/1540817
Branch: androidx-main
commit b8ed9da43f816d4ea8c0f19330b280b2a47cfd3b
Author: Dustin Lam <dustinlam@google.com>
Date: Wed Jan 06 16:14:16 2021
Prevent PageFetcher from leaking InvalidateCallbacks
In cases where PagingSource invalidates itself before a new generation
can be kicked off, PageFetcher has a fast-path which immediately creates
a new PagingSource but during this process leaks a listener.
Relnote: "Fixed a rare memory leak which happens when a PagingSource is
invalidated before PageFetcher can even begin to start loading from it."
Fixes: 174625633
Test: ./gradlew paging:paging-common:test
Change-Id: I9606bc3c393a40d732bf633b721b13b23c46db02
M paging/common/src/main/kotlin/androidx/paging/PageFetcher.kt
M paging/common/src/main/kotlin/androidx/paging/PagingSource.kt
M paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
Description
just noticed this while fixing the ANR bug. looks like we don't unregister from DataSource at all and we also don't unregister from latest used PagingSource