Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Desktop: fix memory leak after recomposition, when composition is dis…
…posed. Fixes JetBrains/compose-multiplatform#538 and https://partnerissuetracker.corp.google.com/issues/170869626#comment4 As far as I figure out how observation works, it is enough to call `clearInvalidObservations` in the end of the every frame. Because all changes will be commited before (on recomposition/layout/draw). Similar code is in https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt;l=378;drc=f3b4f4f28cf61d4434af59d9247a9d2f6d5d70e7. Bug: 183493610 Test: JetBrains/compose-multiplatform#538 (comment), click "Next" multiple times, run VisualVM, run GC, dump heap, find "Presenter" Test: ./gradlew jvmTest desktopTest -Pandroidx.compose.multiplatformEnabled=true Change-Id: I864f4e7aeca28547465ea468229e19426d7b2827
- Loading branch information