Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BottomSheet] Fix activity leak when setting states on destroying act…
…ivities The activity leak can happen in a corner case: setting bottom sheet state when the bottom sheet is dismissed and the host activity is closed. In this situation SettleRunnable will be posted to ViewRootImpl since the bottom sheet is not attached, which leaves references of the dismissed bottom sheet (and thus the destroyed activity) in ViewRootImpl and causes activity leak. Fixes this by using weak reference in SettleRunnable instead of the strong reference, which is the standard practice of the BottomSheetBehavior class. Resolves #1417 PiperOrigin-RevId: 430709002
- Loading branch information